diff --git a/druid-spring-boot-autoconfigure/pom.xml b/druid-spring-boot-autoconfigure/pom.xml index 7af6375..3028939 100644 --- a/druid-spring-boot-autoconfigure/pom.xml +++ b/druid-spring-boot-autoconfigure/pom.xml @@ -7,7 +7,7 @@ com.github.drtrang druid-spring-boot - 1.0.3 + 1.0.4-SNAPSHOT druid-spring-boot-autoconfigure diff --git a/druid-spring-boot-samples/pom.xml b/druid-spring-boot-samples/pom.xml index fcbf498..fddd62e 100644 --- a/druid-spring-boot-samples/pom.xml +++ b/druid-spring-boot-samples/pom.xml @@ -7,7 +7,7 @@ com.github.drtrang druid-spring-boot - 1.0.3 + 1.0.4-SNAPSHOT druid-spring-boot-samples diff --git a/druid-spring-boot-samples/src/main/java/com/github/trang/druid/DruidSpringBootStarterApplication.java b/druid-spring-boot-samples/src/main/java/com/github/trang/druid/DruidSpringBootStarterApplication.java index 646c90b..220438f 100644 --- a/druid-spring-boot-samples/src/main/java/com/github/trang/druid/DruidSpringBootStarterApplication.java +++ b/druid-spring-boot-samples/src/main/java/com/github/trang/druid/DruidSpringBootStarterApplication.java @@ -7,6 +7,8 @@ import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import java.util.Optional; + /** * DruidSpringBootStarterApplication * @@ -22,11 +24,12 @@ public class DruidSpringBootStarterApplication implements CommandLineRunner { } @Autowired - private CityMapper cityMapper; + private Optional cityMapper; @Override public void run(String... args) throws Exception { - System.out.println(cityMapper.findAll()); + cityMapper.map(CityMapper::findAll) + .ifPresent(cities -> cities.forEach(System.out::println)); } } \ No newline at end of file diff --git a/druid-spring-boot-starter/pom.xml b/druid-spring-boot-starter/pom.xml index 42c838d..c517cde 100644 --- a/druid-spring-boot-starter/pom.xml +++ b/druid-spring-boot-starter/pom.xml @@ -7,7 +7,7 @@ com.github.drtrang druid-spring-boot - 1.0.3 + 1.0.4-SNAPSHOT druid-spring-boot-starter diff --git a/pom.xml b/pom.xml index d108ba2..020efe4 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.github.drtrang druid-spring-boot - 1.0.3 + 1.0.4-SNAPSHOT pom ${project.artifactId} @@ -275,6 +275,7 @@ ${project.build.sourceEncoding} ${java.version} ${java.version} + -parameters