You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juneau.apache.org by ja...@apache.org on 2019/10/14 13:54:38 UTC
[juneau-petstore] 19/22: spring data
This is an automated email from the ASF dual-hosted git repository.
jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau-petstore.git
commit 0b6a461d30c0cf83db8a8d047d2d8d783545e020
Author: rasa <fi...@gmail.com>
AuthorDate: Mon Oct 14 14:12:28 2019 +0300
spring data
---
.../java/org/apache/juneau/petstore/service/PetStoreService.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/juneau-petstore-server/src/main/java/org/apache/juneau/petstore/service/PetStoreService.java b/juneau-petstore-server/src/main/java/org/apache/juneau/petstore/service/PetStoreService.java
index 352d6fd..f633983 100644
--- a/juneau-petstore-server/src/main/java/org/apache/juneau/petstore/service/PetStoreService.java
+++ b/juneau-petstore-server/src/main/java/org/apache/juneau/petstore/service/PetStoreService.java
@@ -29,6 +29,7 @@ import org.springframework.beans.factory.annotation.Autowired;
+
/**
* Pet store database application.
* <p>
@@ -110,7 +111,7 @@ public class PetStoreService {
* @throws IdNotFound If pet was not found.
*/
public Pet getPet(long id) throws IdNotFound {
- return petRepository.getOne(id);
+ return petRepository.findById(id).get();
}
/**
@@ -121,7 +122,7 @@ public class PetStoreService {
* @throws IdNotFound If order was not found.
*/
public Order getOrder(long id) throws IdNotFound {
- return orderRepository.getOne(id);
+ return orderRepository.findById(id).get();
}
/**