-
-
Notifications
You must be signed in to change notification settings - Fork 462
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: move legacy codes to legacy folder
- Loading branch information
Showing
171 changed files
with
285 additions
and
313 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
108 changes: 54 additions & 54 deletions
108
...ava/com/example/demo/DataInitializer.java → ...ava/com/example/demo/DataInitializer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,55 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package com.example.demo; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.context.event.ContextRefreshedEvent; | ||
import org.springframework.context.event.EventListener; | ||
import org.springframework.data.domain.Sort; | ||
import org.springframework.data.r2dbc.core.DatabaseClient; | ||
import org.springframework.stereotype.Component; | ||
|
||
import static org.springframework.data.domain.Sort.Order.desc; | ||
|
||
/** | ||
* @author hantsy | ||
*/ | ||
@Component | ||
@Slf4j | ||
class DataInitializer { | ||
|
||
private final DatabaseClient databaseClient; | ||
|
||
public DataInitializer(DatabaseClient databaseClient) { | ||
this.databaseClient = databaseClient; | ||
} | ||
|
||
@EventListener(value = ContextRefreshedEvent.class) | ||
public void init() { | ||
log.info("start data initialization ..."); | ||
this.databaseClient.insert() | ||
.into("posts") | ||
//.nullValue("id", Integer.class) | ||
.value("title", "First post title") | ||
.value("content", "Content of my first post") | ||
// see: https://github.com/spring-projects/spring-data-r2dbc/issues/251 | ||
// .map((r, m) -> r.get("id", Integer.class)) | ||
.map((r, m) -> r.get(0, Integer.class)) | ||
.all() | ||
.log() | ||
.thenMany( | ||
this.databaseClient.select() | ||
.from("posts") | ||
.orderBy(Sort.by(desc("id"))) | ||
.as(Post.class) | ||
.fetch() | ||
.all() | ||
.log() | ||
) | ||
.subscribe(null, null, () -> log.info("initialization is done...")); | ||
} | ||
|
||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package com.example.demo; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.context.event.ContextRefreshedEvent; | ||
import org.springframework.context.event.EventListener; | ||
import org.springframework.data.domain.Sort; | ||
import org.springframework.data.r2dbc.core.DatabaseClient; | ||
import org.springframework.stereotype.Component; | ||
|
||
import static org.springframework.data.domain.Sort.Order.desc; | ||
|
||
/** | ||
* @author hantsy | ||
*/ | ||
@Component | ||
@Slf4j | ||
class DataInitializer { | ||
|
||
private final DatabaseClient databaseClient; | ||
|
||
public DataInitializer(DatabaseClient databaseClient) { | ||
this.databaseClient = databaseClient; | ||
} | ||
|
||
@EventListener(value = ContextRefreshedEvent.class) | ||
public void init() { | ||
log.info("start data initialization ..."); | ||
this.databaseClient.insert() | ||
.into("posts") | ||
//.nullValue("id", Integer.class) | ||
.value("title", "First post title") | ||
.value("content", "Content of my first post") | ||
// see: https://github.com/spring-projects/spring-data-r2dbc/issues/251 | ||
// .map((r, m) -> r.get("id", Integer.class)) | ||
.map((r, m) -> r.get(0, Integer.class)) | ||
.all() | ||
.log() | ||
.thenMany( | ||
this.databaseClient.select() | ||
.from("posts") | ||
.orderBy(Sort.by(desc("id"))) | ||
.as(Post.class) | ||
.fetch() | ||
.all() | ||
.log() | ||
) | ||
.subscribe(null, null, () -> log.info("initialization is done...")); | ||
} | ||
|
||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
78 changes: 39 additions & 39 deletions
78
...ava/com/example/demo/DataInitializer.java → ...ava/com/example/demo/DataInitializer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,40 @@ | ||
package com.example.demo; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.boot.ApplicationArguments; | ||
import org.springframework.boot.ApplicationRunner; | ||
import org.springframework.data.domain.Sort; | ||
import org.springframework.data.r2dbc.core.DatabaseClient; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.util.List; | ||
|
||
import static org.springframework.data.domain.Sort.Order.desc; | ||
|
||
@Component | ||
@Slf4j | ||
@RequiredArgsConstructor | ||
class DataInitializer implements ApplicationRunner { | ||
|
||
private final PostRepository posts; | ||
|
||
@Override | ||
public void run(ApplicationArguments args) throws Exception { | ||
log.info("start data initialization..."); | ||
this.posts | ||
.saveAll( | ||
List.of( | ||
Post.builder().title("Post one").content("The content of post one").build(), | ||
Post.builder().title("Post tow").content("The content of post tow").build() | ||
) | ||
) | ||
.thenMany( | ||
this.posts.findAll() | ||
) | ||
.subscribe((data) -> log.info("post:" + data), | ||
(err) -> log.error("error" + err), | ||
() -> log.info("initialization is done...") | ||
); | ||
} | ||
package com.example.demo; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.boot.ApplicationArguments; | ||
import org.springframework.boot.ApplicationRunner; | ||
import org.springframework.data.domain.Sort; | ||
import org.springframework.data.r2dbc.core.DatabaseClient; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.util.List; | ||
|
||
import static org.springframework.data.domain.Sort.Order.desc; | ||
|
||
@Component | ||
@Slf4j | ||
@RequiredArgsConstructor | ||
class DataInitializer implements ApplicationRunner { | ||
|
||
private final PostRepository posts; | ||
|
||
@Override | ||
public void run(ApplicationArguments args) throws Exception { | ||
log.info("start data initialization..."); | ||
this.posts | ||
.saveAll( | ||
List.of( | ||
Post.builder().title("Post one").content("The content of post one").build(), | ||
Post.builder().title("Post tow").content("The content of post tow").build() | ||
) | ||
) | ||
.thenMany( | ||
this.posts.findAll() | ||
) | ||
.subscribe((data) -> log.info("post:" + data), | ||
(err) -> log.error("error" + err), | ||
() -> log.info("initialization is done...") | ||
); | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
92 changes: 46 additions & 46 deletions
92
data-r2dbc/nbactions.xml → legacy/data-r2dbc/nbactions.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,46 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<actions> | ||
<action> | ||
<actionName>run</actionName> | ||
<packagings> | ||
<packaging>jar</packaging> | ||
</packagings> | ||
<goals> | ||
<goal>process-classes</goal> | ||
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal> | ||
</goals> | ||
<properties> | ||
<exec.args>-classpath %classpath com.example.demo.Application</exec.args> | ||
<exec.executable>java</exec.executable> | ||
</properties> | ||
</action> | ||
<action> | ||
<actionName>debug</actionName> | ||
<packagings> | ||
<packaging>jar</packaging> | ||
</packagings> | ||
<goals> | ||
<goal>process-classes</goal> | ||
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal> | ||
</goals> | ||
<properties> | ||
<exec.args>-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath com.example.demo.Application</exec.args> | ||
<exec.executable>java</exec.executable> | ||
<jpda.listen>true</jpda.listen> | ||
</properties> | ||
</action> | ||
<action> | ||
<actionName>profile</actionName> | ||
<packagings> | ||
<packaging>jar</packaging> | ||
</packagings> | ||
<goals> | ||
<goal>process-classes</goal> | ||
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal> | ||
</goals> | ||
<properties> | ||
<exec.args>-classpath %classpath com.example.demo.Application</exec.args> | ||
<exec.executable>java</exec.executable> | ||
</properties> | ||
</action> | ||
</actions> | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<actions> | ||
<action> | ||
<actionName>run</actionName> | ||
<packagings> | ||
<packaging>jar</packaging> | ||
</packagings> | ||
<goals> | ||
<goal>process-classes</goal> | ||
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal> | ||
</goals> | ||
<properties> | ||
<exec.args>-classpath %classpath com.example.demo.Application</exec.args> | ||
<exec.executable>java</exec.executable> | ||
</properties> | ||
</action> | ||
<action> | ||
<actionName>debug</actionName> | ||
<packagings> | ||
<packaging>jar</packaging> | ||
</packagings> | ||
<goals> | ||
<goal>process-classes</goal> | ||
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal> | ||
</goals> | ||
<properties> | ||
<exec.args>-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath com.example.demo.Application</exec.args> | ||
<exec.executable>java</exec.executable> | ||
<jpda.listen>true</jpda.listen> | ||
</properties> | ||
</action> | ||
<action> | ||
<actionName>profile</actionName> | ||
<packagings> | ||
<packaging>jar</packaging> | ||
</packagings> | ||
<goals> | ||
<goal>process-classes</goal> | ||
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal> | ||
</goals> | ||
<properties> | ||
<exec.args>-classpath %classpath com.example.demo.Application</exec.args> | ||
<exec.executable>java</exec.executable> | ||
</properties> | ||
</action> | ||
</actions> |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.