attribute « Load « JPA Q&A





1. Not load some attribute when loading an object    forum.hibernate.org

2. Lazy load selective attributes    forum.hibernate.org

It is not possible to implement this w/o build-time bytecode processing or control of the classloader. And I still insist it is not as good a feature as it sounds (vulnerable to n+1 selects). In Hibernate you should use queries with projection, or the lightweight class pattern to achieve your goals(more efficiently).

3. child set gets loaded even though lazy attribute set to true    forum.hibernate.org

A sql query gets called to load the children set irrespective of the value of lazy attribute (i've tried true and false, and it makes no difference). Please let me know how can i avoid loading the children set. I do not need to load them and want to avoid making the unnecessary sql call. PS: I'm on hibernate version 2.0. ...

4. need to load attributes of class    forum.hibernate.org

login= Login$$EnhancerByCGLIB$$731c59cf (id=353) CGLIB$BOUND= true CGLIB$CALLBACK_0= CGLIBLazyInitializer (id=362) componentIdType= null constructed= true entityName= "cz.bes.bec.core.role.role.data.Login" getIdentifierMethod= Method (id=282) id= Integer (id=364) initialized= false interfaces= Class[1] (id=284) overridesEquals= false persistentClass= Class (cz.bes.bec.core.role.role.data.Login) (id=71) replacement= null session= SessionImpl (id=344) setIdentifierMethod= null target= null unwrap= false CGLIB$CONSTRUCTED= true code= null description= null id= null name= null password= null uid= null

5. Load a lazy attribute    forum.hibernate.org

Hibernate version: 3.0.5 Mapping documents: Code: ...