spring-in-action-6-samples icon indicating copy to clipboard operation
spring-in-action-6-samples copied to clipboard

Questions with IngredientRef domain

Open KianYang-Lee opened this issue 1 year ago • 2 comments

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.

KianYang-Lee avatar Oct 25 '23 04:10 KianYang-Lee

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.

hasanraj3100 avatar Dec 06 '23 20:12 hasanraj3100

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

Nick-Mathews avatar Jan 11 '24 21:01 Nick-Mathews