Is it possible to force Eager fetch on entity update?

Hi everyone,

I have issues for an update, when i get a returned object, the child does not come as they are lazy fetched.
Is it possible to force eager fetch for entities, eventhough they are automatically generated as lazy? (Or even take control over the Lazy fetch)

Thank you very much!

Hi,

The default fetch type for relationships are by default LAZY. That is actually not supported to change it. This ensure same and uniform behavior for all entities.

BTW, the LAZY doesn’t load the relationships unless explicitly “asked for” via getter. So it should not be an issue. Can you explain your case ?

About the EAGER type, loading things from database is expensive in terms of the time. It takes to load all that information into java object AND keep them in memory. Ans it can be crazy if one of the relationships points to an object that also has 10 relationships …