habuma / spring-in-action-6-samples

Sample code from Spring in Action 6
486 stars 342 forks source link

Questions with IngredientRef domain #22

Open KianYang-Lee opened 1 year ago

KianYang-Lee commented 1 year ago

A domain IngredientRef is mentioned and created somewhere in chap 1 or 2. But by the end of chapter 3 (starting from Spring Data JPA) the domain of IngredientRef is already not mentioned.

What is its significance? It is quite confusing.

hasanraj3100 commented 11 months ago

Exactly. The problem was created right before the 3.2 starts. In JdbcOrderRepository, he created a method saveIngredientRefs(long, List\<IngredientRefs>). and called this method from saveTaco() . But while calling the method he passed tacoId and taco.getIngredients() as parameters.. But taco.getIngredients() returns a List\<Ingredient> where the saveIngredientRefs() requires a List\<IngredientRef>. I am also confused what to do now.

If you have found any solution please let me know.

Nick-Mathews commented 10 months ago

The solution that I used for this issue was found in another thread. Leaving the link here for anyone still having this problem.

https://github.com/habuma/spring-in-action-6-samples/issues/11#issuecomment-1229146426