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.  [ 2 posts ] 
Author Message
 Post subject: Distinct question
PostPosted: Wed Dec 27, 2006 11:39 am 
Beginner
Beginner

Joined: Mon Sep 04, 2006 7:18 am
Posts: 45
Hello. I have a table with many values.

I would like to do something like this in Hibernate:

select distinct fabrikatid,modellbetegnelse,modellvariantid,type from motor;

This should retrieve a list of MotorData objects which are distinct.

fabrikatid is from FabrikatData object and modellvariantid is from ModellvariantData object. The rest are properties in MotorData.

Can someone help me please?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 28, 2006 9:38 am 
Expert
Expert

Joined: Tue Dec 28, 2004 7:02 am
Posts: 573
Location: Toulouse, France
By default, calling such query with HQL will return an Object[]. Have a look here: http://www.hibernate.org/hib_docs/v3/re ... ryhql.html.

If you give more infos about relationships between your objects and precise what you'd like to do with it, maybe we'll be able to help you more.

_________________
Baptiste
PS : please don't forget to give credits below if you found this answer useful :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

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.