This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Object Relational Mapping and the fly likes Help Reg. DISTINCT ROOT Entity Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Help Reg. DISTINCT ROOT Entity" Watch "Help Reg. DISTINCT ROOT Entity" New topic

Help Reg. DISTINCT ROOT Entity

Raminder Singh
Ranch Hand

Joined: Mar 01, 2002
Posts: 72
I have a query:
In Criteria.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY); is Primary Key Column is DISTINCT_ROOT_ENTITY?
i have a table say

ID -- Country -- City
1 -- IN -- DEL
2 -- IN -- MUM
3 -- IN -- CHD
4 -- US -- NYC
5 -- US -- DEN

I am getting list representing ROW as an object. I want to get distinct 'country' records? here ID is Primary Key. how
DISTINCT_ROOT_ENTITY on country should be set?

pascal betz
Ranch Hand

Joined: Jun 19, 2001
Posts: 547
show the query/criteria you are using.

Arun Kumarr
Ranch Hand

Joined: May 16, 2005
Posts: 513

[ November 06, 2006: Message edited by: Arun Kumarr ]

If you are not laughing at yourself, then you just didn't get the joke.
I agree. Here's the link:
subject: Help Reg. DISTINCT ROOT Entity