This content has been marked as final.
Show 2 replies
-
1. Re: ManyToOne & lazy initialization
adamw May 26, 2010 2:29 AM (in response to trashbat)Just to make sure, you've got an audited relation, and you call entity.getRelatedEntity().getSomeProperty() and you don't get the expected result?
What is null in your case?
Adam
-
2. Re: ManyToOne & lazy initialization
trashbat Jun 1, 2010 8:42 AM (in response to adamw)Sorry, been away on holiday.
Yes, exactly that. The property is null because getRelatedEntity() returns a proxy.
However I have resolved my problem by calling Hibernate.initialize() on the entity and property. Reading around, this is probably fairly obvious, but I didn't expect it to be lazy in the first place.