Hi,
Scenario: --------- I have a polymorphic many-to-one which needs to be lazily loaded. I use lazy="no-proxy" with bytecode instrumentation. The target entity in the association can be null. So i use the attribute not-found="ignore" to avoid throwing exception at run time.
Issue: ------ Hibernate still throws org.hibernate.UnresolvableObjectException: No row with the given identifier exists:
Observed that not-found="ignore" is not working properly if lazy="no-proxy" is used (its not even considered i guess). Also, exception occur only if there are more than one record associated with the null target entity.
Eg : Employee -> Company (Many employees associated to one Company which is null)
I cant do much about the data/existing framework since its a migration project. Can anyone help me out?
Thanks and Regards, JiVi
|