I am not getting any exception.My concern is that, it is talking awful lot of time to load a list of AOISELECTSETDETAIL objects(am using session.load()) as it is fetching the associated AOI object as well which in turn have a lot of properties set to lazy="false".I have set lazy="proxy" on definition of property AOI in AOISELECTSETDETAIL hbm file.But still that is not taking effect as the whole AOI entity is set to lazy="false" in its hbm as i highlighted below.
I done want to change the lazy setting on the associated hbm.
So the question is is there any way to avoid loading the associated object irrespective of what is set at the entity level in its hbm.
However setting lazy=false for entity with associations is not recommended. The default should be lazy loading enabled, the operation that need a particular collection/assocaition should initialize the collection that is required.
Joined: Aug 17, 2010
Thanks for the reply Rishi.I can ovverride the fetchmode on the properties directly defined on the entitiy I am querying on.But the problem here is because of the settings on a associated entity of the current entity.
Definition of entity B that is associated to class A is below
<class name="B" table="B" lazy="false" entity-name="B">
associated property B is set to lazy="proxy" which is not taking effect as B is set to lazy="false" at the entity level.
Now when i am trying to load entity A, i can override fetchmode of it's own associtions which is any way set to lazy="proxy".I don't have any problem here.
The issue is cant override fetch mode of entity B,i.e set at its entity level.
Well, due to certain reasons which are part of business logic, we have to set lazy="false" for B at entity level.