attribute « Load « JPA Q&A

1. Not load some attribute when loading an object

2. Lazy load selective attributes

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

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

login= Login$$EnhancerByCGLIB$$731c59cf (id=353) CGLIB$BOUND= true CGLIB$CALLBACK_0= CGLIBLazyInitializer (id=362) componentIdType= null constructed= true entityName= "" getIdentifierMethod= Method (id=282) id= Integer (id=364) initialized= false interfaces= Class[1] (id=284) overridesEquals= false persistentClass= Class ( (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

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