-->
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.  [ 3 posts ] 
Author Message
 Post subject: Join using Criteria
PostPosted: Thu Oct 30, 2003 5:47 pm 
Newbie

Joined: Thu Oct 30, 2003 5:38 pm
Posts: 9
Location: CA
I have an Event that references Cause which contains a Set of Reason.
I can make a query string allowing a query of Event into the set of reasons by doing a join, but haven't figured out how to make this work using Criteria.

It seems that Criteria.createCriteria( String ) should work, but all of my attempts are failing so I'm obviously not doing it right.

Here's what I though would work:
criteria = session.createCriteria( Event.class );
criteria = criteria.createCriteria( "cause.reasons" );
. . .
Exception thrown says "...could not resolve property: cause.reasons"

Can someone point out the error of my ways? Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 30, 2003 5:55 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
criteria = session.createCriteria( Event.class );
criteria = criteria.createCriteria( "cause" );
criteria = criteria.createCriteria( "reasons" );


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 30, 2003 6:10 pm 
Newbie

Joined: Thu Oct 30, 2003 5:38 pm
Posts: 9
Location: CA
Get the same exception with this too ... I had tried it earlier
Could it have something to do with how the set is defined in xml?


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