-
1. Re: AuditReader throwing exception in case of eager loading for many-to-one relationships
hernanbolido Apr 30, 2010 7:45 AM (in response to amit1)Hi!
There is a bug in envers related with this: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3854.
The problem arises when you mark a class as lazy="false". In your example...
...
<class name="EmployeeImpl" table="LP_EMPLOYEE" lazy="false" >
...
You can mark the relations to employee as lazy.
I hope it will help you.
Regarsd. Hernán.
-
2. Re: AuditReader throwing exception in case of eager loading for many-to-one relationships
amit1 May 2, 2010 9:08 AM (in response to hernanbolido)Hi Hernán,
Thanks for the help but the problem is that there are more than 100 places where this entity is being used. If i mark the relation as lazy instead of the entity then i will have to make the changes at all the places.
Also would like to know if "new ToOneDelegateSessionImplementor(versionsReader, entityClass, entityId, revision, verCfg).doImmediateLoad(referencedEntityName) " is the right API to use for eager loading?
Thanks,
Amit
-
3. Re: AuditReader throwing exception in case of eager loading for many-to-one relationships
adamw May 4, 2010 7:48 AM (in response to amit1)It's a good workaround until the bug is fixed
Adam
-
4. Re: AuditReader throwing exception in case of eager loading for many-to-one relationships
amit1 May 6, 2010 11:35 AM (in response to adamw)Thanks Adam