Timeline for Best way to handle lazy models with mapstruct and spring transnational scope
Current License: CC BY-SA 4.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 29 at 10:18 | comment | added | Julien | to me this method is bypassing the LAZY configuration and force it to be EAGER. If I'm right you may as well set engine to EAGER. | |
Jan 11, 2021 at 16:56 | comment | added | Youans | Yeah, I just thought you might not know that, since I have just know it recently | |
Jan 11, 2021 at 15:49 | comment | added | Marc | @YouYou I am glad I could help. I see that there are a lot of discussions about OSIV. Even though it's considered an anti-pattern by many it's enabled by default in Spring Boot (with a warning). So I listed it as an additional approach since in some use cases can still be relevant. | |
Jan 11, 2021 at 15:08 | comment | added | Youans |
For spring.jpa.open-in-view=true the OSIV is considered an Anti-Pattern check @Vlad Mihalcea answer here stackoverflow.com/a/37526397/1460591
|
|
Jan 11, 2021 at 15:08 | comment | added | Youans |
Thanks for your answer, For CarService#getCarWithEngine I like this but doing this for all models could be a pretty damn job to cover all view scenarios and also will pollute the service imagine that we have withEngine withEngineAndManufacturer withEngineAndManufacturerWithOriginCountry however I would think that this would be the best approach yet I can think of right now at least it will avoid issuing the query to load the lazy field since on that case it will be returned by the original query
|
|
Jan 11, 2021 at 14:20 | review | First posts | |||
Jan 11, 2021 at 14:31 | |||||
Jan 11, 2021 at 14:16 | history | answered | Marc | CC BY-SA 4.0 |