-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: One-To-One Lazy Loading using JPA annotations
PostPosted: Wed Feb 27, 2008 5:46 am 
Newbie

Joined: Wed May 09, 2007 10:36 am
Posts: 4
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


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 27, 2008 5:54 am 
Newbie

Joined: Wed May 09, 2007 10:36 am
Posts: 4
OK the same problem is described here:
http://forum.hibernate.org/viewtopic.ph ... annotation

But the answer is still not given.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.