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.  [ 1 post ] 
Author Message
 Post subject: ManyToOne non primary key - sequential select
PostPosted: Wed Jan 26, 2011 3:28 pm 
Newbie

Joined: Tue Dec 14, 2010 2:55 pm
Posts: 2
I have a ManyToOne from entity A to entity B on a non primary unique key. If I annotation the association with @LazyToOne and use build time instrumentation, I can get it to be loaded lazily. The problem I'm having is if I create a criteria query that does a join for this assoication, whenever I go to access entity B (the one), hibernate is issuing a sequential select on entity A for the join column to entity B, even though entity B was loaded via the join. If I don't do the join, hibernate will do this same sequential select and then select entity B, which is what is expected in this case, even though I am unsure as to why hibernate is doing another query on entity A, since it is already loaded in the session. Both of these occurences seem like a bug. Maybe this is a bug in the enhanced class?


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

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.