-->
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: distinct selection problem!
PostPosted: Tue Jan 25, 2005 9:12 pm 
Newbie

Joined: Thu Dec 16, 2004 2:58 am
Posts: 5
I just wanna get a list of object distinct by one property of the objects, as using following HQL:
Code:
List allObjs = new ObjectManager().find("select distinct o.OneProp from Object o where 0.OtherProp = someValue");

but when I convert the object in the list like:
Code:
(Object)o = (Object)allObjs.get(i);

,the ClassCastException occured!
It looks like the above find() method only returns a list of property, not the object, but what I want is the object, so is there anybody can tell me the right HQL?

Yours,
Wang Q


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.