-->
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: Criteria API Question
PostPosted: Mon Aug 28, 2006 5:09 am 
Newbie

Joined: Mon Aug 28, 2006 4:58 am
Posts: 2
How I can create Criteria object for following query

"from BusinessObject bo where (<some condition with bo>) or (<>) or (<>) and (<>)"

What are classes I would use for it?

Sorry, if I ask not correctly
Hibernate version: 3.1


Top
 Profile  
 
 Post subject: Try this
PostPosted: Fri Sep 01, 2006 7:29 am 
Newbie

Joined: Fri Jul 28, 2006 9:52 am
Posts: 12
Code:
Criteria oCriteria = session.createCriteria(YourObject.class);
oCriteria.add(Restrictions.eq("YourColumnNameInPOJO","CompareValue"));


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 01, 2006 9:02 am 
Regular
Regular

Joined: Thu Nov 13, 2003 2:55 am
Posts: 71
Location: Sweden
See Restrictions.and() and or()


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.