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.  [ 4 posts ] 
Author Message
 Post subject: NHibernates behavior when not finding an object
PostPosted: Sun Sep 14, 2008 3:31 am 
Newbie

Joined: Thu Feb 21, 2008 12:30 pm
Posts: 7
Hi ,

I have a view that has
a bag property that defines a many to many relation to another view.

The issue is that the the two views are related through a regular table which exposes all the relations between the objects - so a user can try
and draw an object in view a , the rel table will show that it is linked to 5 objects in table b , but view b will only expose 3 objects to the user.
In that case NHibernate will throw exception that the object could not be found.

I could create a view for the rel table which preformes the same elimination as the two other views , but , my question is , if there is a way to config nhibernate not to throw an exception when not finding an object but to simply not returning nothing if not finding it ?

Best regards ,

Ishai


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 14, 2008 6:33 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
As far as I know many-to-many supports not-found="ignore" which results in a null value for a row that does not exist. Is that what you need ?

_________________
--Wolfgang


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 14, 2008 7:02 am 
Newbie

Joined: Thu Feb 21, 2008 12:30 pm
Posts: 7
yes ! great ! thats exactly what i need .

thank you.


ishai


Last edited by Ishai on Sun Sep 14, 2008 7:10 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 14, 2008 7:10 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
Have a look at the reference documentation:

http://www.hibernate.org/hib_docs/nhibernate/1.2/reference/en/html/collections.html#collections-ofvalues

_________________
--Wolfgang


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.