Merge pull request #9462 from sampada07/JAVA-913
JAVA-913: Migrate parent-boot-1 articles to parent-boot-2
This commit is contained in:
commit
94f4acbe39
@ -9,9 +9,9 @@
|
||||
|
||||
<parent>
|
||||
<groupId>com.baeldung</groupId>
|
||||
<artifactId>parent-boot-1</artifactId>
|
||||
<artifactId>parent-boot-2</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<relativePath>../../parent-boot-1</relativePath>
|
||||
<relativePath>../../parent-boot-2</relativePath>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
@ -35,6 +35,11 @@
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.bytebuddy</groupId>
|
||||
<artifactId>byte-buddy-dep</artifactId>
|
||||
<version>${bytebuddy.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
@ -55,8 +60,9 @@
|
||||
</dependencyManagement>
|
||||
|
||||
<properties>
|
||||
<spring-cloud-dependencies.version>Brixton.SR7</spring-cloud-dependencies.version>
|
||||
<postgresql.version>9.4-1201-jdbc4</postgresql.version>
|
||||
<spring-cloud-dependencies.version>Hoxton.SR4</spring-cloud-dependencies.version>
|
||||
<postgresql.version>42.2.10</postgresql.version>
|
||||
<bytebuddy.version>1.10.10</bytebuddy.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
@ -1,5 +1,7 @@
|
||||
package com.baeldung.spring.cloud.connectors.heroku.book;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -15,7 +17,7 @@ public class BookController {
|
||||
}
|
||||
|
||||
@GetMapping("/{bookId}")
|
||||
public Book findBook(@PathVariable Long bookId) {
|
||||
public Optional<Book> findBook(@PathVariable Long bookId) {
|
||||
return bookService.findBookById(bookId);
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.baeldung.spring.cloud.connectors.heroku.book;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
@ -15,8 +17,8 @@ public class BookService {
|
||||
this.bookRepository = bookRepository;
|
||||
}
|
||||
|
||||
public Book findBookById(Long bookId) {
|
||||
return bookRepository.findOne(bookId);
|
||||
public Optional<Book> findBookById(Long bookId) {
|
||||
return bookRepository.findById(bookId);
|
||||
}
|
||||
|
||||
@Transactional(propagation = Propagation.REQUIRED)
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.baeldung.spring.cloud.connectors.heroku.product;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -15,7 +17,7 @@ public class ProductController {
|
||||
}
|
||||
|
||||
@GetMapping("/{productId}")
|
||||
public Product findProduct(@PathVariable Long productId) {
|
||||
public Optional<Product> findProduct(@PathVariable Long productId) {
|
||||
return productService.findProductById(productId);
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.baeldung.spring.cloud.connectors.heroku.product;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
@ -15,8 +17,8 @@ public class ProductService {
|
||||
this.productRepository = productRepository;
|
||||
}
|
||||
|
||||
public Product findProductById(Long productId) {
|
||||
return productRepository.findOne(productId);
|
||||
public Optional<Product> findProductById(Long productId) {
|
||||
return productRepository.findById(productId);
|
||||
}
|
||||
|
||||
@Transactional(propagation = Propagation.REQUIRED)
|
||||
|
@ -10,9 +10,9 @@
|
||||
|
||||
<parent>
|
||||
<groupId>com.baeldung</groupId>
|
||||
<artifactId>parent-boot-1</artifactId>
|
||||
<artifactId>parent-boot-2</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<relativePath>../../parent-boot-1</relativePath>
|
||||
<relativePath>../../parent-boot-2</relativePath>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
@ -40,8 +40,8 @@
|
||||
</dependencyManagement>
|
||||
|
||||
<properties>
|
||||
<spring-cloud-dependencies.version>Brixton.SR7</spring-cloud-dependencies.version>
|
||||
<spring-cloud-task.version>1.2.2.RELEASE</spring-cloud-task.version>
|
||||
<spring-cloud-dependencies.version>Hoxton.SR4</spring-cloud-dependencies.version>
|
||||
<spring-cloud-task.version>2.2.3.RELEASE</spring-cloud-task.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
|
@ -45,6 +45,13 @@
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-task-batch</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.bytebuddy</groupId>
|
||||
<artifactId>byte-buddy-dep</artifactId>
|
||||
<version>${bytebuddy.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
@ -63,6 +70,7 @@
|
||||
|
||||
<properties>
|
||||
<start-class>com.baeldung.TaskDemo</start-class>
|
||||
<bytebuddy.version>1.10.10</bytebuddy.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
|
@ -1,6 +1,6 @@
|
||||
spring:
|
||||
datasource:
|
||||
url: jdbc:h2:mem:springcloud
|
||||
url: jdbc:h2:mem:springcloud;DB_CLOSE_ON_EXIT=FALSE
|
||||
username: sa
|
||||
password:
|
||||
jpa:
|
||||
|
@ -50,8 +50,7 @@
|
||||
</build>
|
||||
|
||||
<properties>
|
||||
<spring-cloud-task.version>1.2.2.RELEASE</spring-cloud-task.version>
|
||||
<spring-cloud-deployer.version>1.3.0.RELEASE</spring-cloud-deployer.version>
|
||||
<spring-cloud-deployer.version>2.3.1.RELEASE</spring-cloud-deployer.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
|
Loading…
x
Reference in New Issue
Block a user