-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple/Default EntityGraphs #51
Comments
Hey, If you use Hibernate, since https://hibernate.atlassian.net/browse/HHH-8776, the concept of "default" EntityGraph defined by this extension is not needed anymore. Here is an example: @Entity
class A {
@OneToOne(fetchType = EAGER)
private B b;
@OneToOne(fetchType = LAZY)
private C c;
} // This will load b + c
aRepository.findById(1, new DynamicEntityGraph(LOAD, Collections.singletonList("c"))); |
From https://docs.oracle.com/javaee/7/tutorial/persistence-entitygraphs001.htm :
|
I had tried that but it doesn't work with Spring Boot and Spring Data which appears to just ignore FetchType Completely, that's why I'm using Entity Graphs in the first place |
Hey! Is it currently possible to set the default entity graph and then have any DynamicEntityGraph's just add attributes on top of the default.
I have a scenario where I'd like certain fields in an Entity to always be Fetched and then be able to choose what other fields using the EntityGraph supplied!
The text was updated successfully, but these errors were encountered: