aspose file tools*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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
Similar Threads
Queries on Entity Beans
EJB Query Problem
about one to one
Hibernate Mapping problem because no primary key in database
what if no ID column in the table for Hibernate?