-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
23cb68c
commit 2ae8051
Showing
4 changed files
with
19 additions
and
25 deletions.
There are no files selected for viewing
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
15 changes: 2 additions & 13 deletions
15
...rder-service/src/main/java/com/example/productorderservice/product/ProductRepository.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,17 +1,6 @@ | ||
package com.example.productorderservice.product; | ||
|
||
import org.springframework.stereotype.Repository; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
@Repository | ||
class ProductRepository { | ||
private Map<Long, Product> persistence = new HashMap<>(); | ||
private Long sequence = 0L; | ||
|
||
public void save(final Product product) { | ||
product.assigId(++sequence); | ||
persistence.put(product.getId(), product); | ||
} | ||
interface ProductRepository extends JpaRepository<Product, Long> { | ||
} |
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
3 changes: 2 additions & 1 deletion
3
product-order-service/src/main/resources/application.properties
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 +1,2 @@ | ||
|
||
spring.jpa.properties.hibernate.show_sql=true | ||
spring.jpa.properties.hibernate.format_sql=true |