-->
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.  [ 7 posts ] 
Author Message
 Post subject: Scalar query and objects instances
PostPosted: Fri Nov 21, 2003 9:09 am 
Newbie

Joined: Mon Nov 17, 2003 11:44 am
Posts: 6
Hye,

We have a scalar query like SELECT DISTINCT A.NAME, A.YEAR, B.CAR ... FROM TABLEA A, TABLEB B ...

Is there a way to retrieve the objets A, B ... in the result.

(In the reality, the query is more complex i.e several tables and a lot of where clauses)

Thank's


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 21, 2003 9:10 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Yes.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 21, 2003 9:12 am 
Newbie

Joined: Mon Nov 17, 2003 11:44 am
Posts: 6
Hye, chris !

You said Yes but how ?

Thank's


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 21, 2003 9:18 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
http://www.hibernate.org/hib_docs/refer ... anguage-s4

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 21, 2003 9:30 am 
Newbie

Joined: Mon Nov 17, 2003 11:44 am
Posts: 6
Thank's chris, but it's a little bit more complicated.

Our query use 'DISTINCT' to evict duplicate rows, but if we use SELECT DISTINCTA, B ... in place of SELECT DISTINCT A.NAME, A.YEAR, B.CAR ... the query returns duplicate rows.


I hope you'll undertand what i mean !

Thank's


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 21, 2003 9:44 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Hm, it shouldn't. Gavin?

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 21, 2003 9:51 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
well, if there are multiple rows with the same data, but different ids then yes, this would happen - of course.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 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.