-->
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.  [ 1 post ] 
Author Message
 Post subject: Criteria Query
PostPosted: Thu Mar 27, 2008 2:37 am 
Newbie

Joined: Mon Mar 10, 2008 6:53 am
Posts: 3
Location: India
Hello,

I want a small help in Criteria Queries.

e.g. my database table is like following

Primary-Key Column : Column-1 : Column-2 : .... : Column-N

1 : : 100 : ... : anydata
2 : 1 : 101 : ... : anydata
3 : : 100 : ... : anydata
4 : 2 : 101 : ... : anydata
5 : 3 : 102 : ... : anydata
6 : 4 : 103 : ... : anydata
7 : : 100 : ... : anydata
8 : 5 : 101 : ... : anydata

I want to narrow my result set based on two columns of the dataset.

first i am getting all valueobjects where column-1 is not null. (i.e. PK 2,4,5,6,8)

now for all of these not null rows i want only those rows when column-2 values are different. i.e. out of 2,4,5,6,8 column 2 values are same for 2,4 and 8 so i want any one of them not all.

is there any way I can add Restriction in my criteria query?

I hope you will understand the problem and will get any solution.

_________________
Tapan Maru


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.