Hibernate version: 3.2.4.ga
Mapping documents:
/**
* The message textual content. The referred class holds the CLOB value and is lazy loaded.
*/
@OneToOne(cascade = CascadeType.ALL, mappedBy = "owner", optional = false, fetch = FetchType.LAZY)
private MessageContent originalContent;
One-To-One lazy loading is described here:
http://www.hibernate.org/162.html
I have done my hibernate-mappings using JPA and Hibernate annotations. So after reading how lazy loading is done in this particular case, I must do the following mapping:
<one-to-one constrained="true" outer-join="false" class="Foo"/>
I don't know why, but how I mapped my property, the lazy loading does not work and "originalContent" still gets populated. How is the correct way to do one-to-one lazy loading mapping using annotations?
I think the key lies in "constrained=true". I have used optional=false for that, but I think it is not the same thing.
I have also tried with hibernate annotations described here:
http://www.hibernate.org/hib_docs/annot ... c-fetching
but still the parameter gets loaded.
Help