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: ICriteria / HQL Help
PostPosted: Tue Aug 29, 2006 3:20 am 
Newbie

Joined: Mon Jan 30, 2006 6:33 pm
Posts: 9
Dear community,

I would appreciate it if someone could help me creating a HQL-Statement or the code to build up a correct criteria.

Here is what I want to express:

I have two identities: Article and ArticleModification. Each Article can have none or multiple ArticleModifiations.
I want to retrieve all Articles which do not have an ArticleModification or if they have one or more, every ArticleModification.LocksArticle must be false.

So something like:

Code:
select art from Article as art inner join art.ArticleModifications artMod where artMod.LocksArticle=0


Do you have an idea?

Thank you!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 29, 2006 4:37 am 
Senior
Senior

Joined: Wed Jun 15, 2005 4:17 am
Posts: 156
I sugest you to start by building the query using SQL. After you've done it you can use it in your app via CreateSqlQuery method. I don't think it can be done using criteria.

radu


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 29, 2006 5:01 am 
Newbie

Joined: Mon Jan 30, 2006 6:33 pm
Posts: 9
It need not be by using a Criteria.
A HQL-Query would also be very nice!


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.