-->
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: Searching a Detail based on a property of a master Class
PostPosted: Mon May 30, 2005 4:40 am 
Is it possible to search for details records, based on a property of a master class.

E.G.
Code:
Class A //Master
{ Id, NameA, CollectionOfB }
Class B // Detail
{ Id, NameB, RefToA }

IList result = session.CreateCriteria(typeof(B))
      .Add(Expression.Eq("RefToA.NameA","SearchNameA")
      .List();


Something like section 12.4 of the Hibernate documentation at
http://www.hibernate.org/hib_docs/refer ... teria.html

Thanks,
Geert


Top
  
 
 Post subject:
PostPosted: Mon May 30, 2005 5:24 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
I don't think this will work, current ICriteria implementation can't handle references to other entities. But try it, maybe I'm thinking too bad of NHibernate :)


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.