Skip to content

Commit 9f8000f

Browse files
updating to Spring Boot M7
1 parent ce6e4c8 commit 9f8000f

File tree

2 files changed

+38
-3
lines changed

2 files changed

+38
-3
lines changed

pom.xml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,41 @@
5454
</plugins>
5555
</build>
5656

57+
<repositories>
58+
<repository>
59+
<id>spring-snapshots</id>
60+
<name>Spring Snapshots</name>
61+
<url>https://repo.spring.io/snapshot</url>
62+
<snapshots>
63+
<enabled>true</enabled>
64+
</snapshots>
65+
</repository>
66+
<repository>
67+
<id>spring-milestones</id>
68+
<name>Spring Milestones</name>
69+
<url>https://repo.spring.io/milestone</url>
70+
<snapshots>
71+
<enabled>false</enabled>
72+
</snapshots>
73+
</repository>
74+
</repositories>
5775

76+
<pluginRepositories>
77+
<pluginRepository>
78+
<id>spring-snapshots</id>
79+
<name>Spring Snapshots</name>
80+
<url>https://repo.spring.io/snapshot</url>
81+
<snapshots>
82+
<enabled>true</enabled>
83+
</snapshots>
84+
</pluginRepository>
85+
<pluginRepository>
86+
<id>spring-milestones</id>
87+
<name>Spring Milestones</name>
88+
<url>https://repo.spring.io/milestone</url>
89+
<snapshots>
90+
<enabled>false</enabled>
91+
</snapshots>
92+
</pluginRepository>
93+
</pluginRepositories>
5894
</project>

src/main/java/guru/springframework/services/ProductServiceImpl.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public List<Product> listAll() {
3535

3636
@Override
3737
public Product getById(String id) {
38-
return productRepository.findOne(id);
38+
return productRepository.findById(id).orElse(null);
3939
}
4040

4141
@Override
@@ -46,8 +46,7 @@ public Product saveOrUpdate(Product product) {
4646

4747
@Override
4848
public void delete(String id) {
49-
productRepository.delete(id);
50-
49+
productRepository.deleteById(id);
5150
}
5251

5352
@Override

0 commit comments

Comments
 (0)