This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread 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 Android Security Essentials Live Lessons this week in the Android 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.
Don't get me started about those stupid light bulbs.
subject: Help Reg. DISTINCT ROOT Entity
Similar Threads
about one to one
what if no ID column in the table for Hibernate?
EJB Query Problem
Queries on Entity Beans
Hibernate Mapping problem because no primary key in database