Force « Load « JPA Q&A

1. Force eager loading of otherwise lazy loaded properties

I've got a Hibernate object which's properties are all loaded lazy. Most of these properties are other Hibernate objects or PersistentSets. Now I want to force Hibernate to eager load these properties ...

2. For lazy relationship how to specify a fetch join that can force a eager loading in JPA?

public EntityA implements Serializable {
    private EntityB b;
How do i dynamically load the EntityB eagerly?

3. Force many to one without loading - no matter what?

Wow... that is a harsh statement. Hibernate is not perfect. Its architecture forces you to break object oriented rules from time to time in order to improve performance. Here, in my opinion, is a classic example of such a situation: Code: public class Account { private String id; private String region; ...

4. Force a lazily loaded field to load with hql

5. Force Property Load