File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 REST with Spring (video course) this week in the Spring 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: 661

[ 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
It's not a secret anymore!