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: Bug: join fetch not obeying not-found=ignore
PostPosted: Tue May 19, 2009 7:10 am 
Newbie

Joined: Fri Apr 03, 2009 10:36 am
Posts: 6
I am building an application on top of a legacy database. Unfortunately, I've come across a foreign key which is set to zero (0) instead of null to indicate the primary key entity is missing.

As there are many other applications running on top of this database, there is not chance I can fix the data. So I have to create my mappings to cope with this situation. Making NHibernate deal with this situation is challenging.

So on my foreign key property I've specified not-found="ignore" so the property becomes null when the foreign key property is dereferenced. However, when I join fetch from the foreign key's entity to the primary key's entity, I get a new Select query issued whenever I use the foreign key property. I believe this is a bug - fetch join should have no need to issue new selects to determine if the fetched entity is null (when not-found="ignore") when the purpose of the join fetch was to obtain the data upfront.

Are there any workarounds for this situation? I've had the idea of using a Formula Property, say, called DoesReallyExist. Are there any other nicer workarounds?


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.