-->
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: query help
PostPosted: Mon Nov 10, 2003 6:43 am 
Regular
Regular

Joined: Tue Aug 26, 2003 6:59 pm
Posts: 89
Location: Somewhere in the Ghetto
I have an Event, with a Set of EventTypes, how can I get a list of all Events with particular EventType?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 10, 2003 7:44 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
from Event event where :ElementType in elements(event.eventTypes)

read section 9 of the reference guide

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 10, 2003 5:17 pm 
Regular
Regular

Joined: Tue Aug 26, 2003 6:59 pm
Posts: 89
Location: Somewhere in the Ghetto
oops, i didnt ask the question correctly, the correct question was:

I have an Event, with a Set of EventTypes, how can I get a list of all Events with any EventType?

i basically have a form that they can select from 10 different EventTypes, if they select 3 eventTypes, any events with either one of those 3 eventTypes selected should be returned

thanks again.. still reading docs and trying to figure it out myself


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 10, 2003 6:29 pm 
Expert
Expert

Joined: Tue Sep 16, 2003 4:06 pm
Posts: 318
Location: St. Petersburg, Russia
select distinct event
from Event as event
where event.type in :typeList


you also need to bind Collection of EventType objects to the "typeList" parameter (use query.setParameterList). For these objects only Id property must be initialized


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.