-->
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: Is it possible to select multiple objects?
PostPosted: Fri Jun 04, 2004 7:05 am 
Newbie

Joined: Sat Nov 01, 2003 12:35 pm
Posts: 11
Hi,
Is it allowed to select multiple kinds of objects in hsql, for example the following hsql:

select usage.product.id usage.cpbr.testSite usage.cpbr.process.name from CPBasicRecordInfo as usage where usage.status = ?

, where there are 3 kinds of objects selected usage.product.id usage.cpbr.testSite usage.cpbr.process.name.

If this is allowed, how to retrieve the returned list?

Regards,
Rice


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 04, 2004 7:32 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
Queries may return multiple objects and/or properties as an array of type Object[]

select mother, offspr, mate.name
from eg.DomesticCat as mother
inner join mother.mate as mate
left outer join mother.kittens as offspr
or as an actual typesafe Java object

select new Family(mother, mate, offspr)
from eg.DomesticCat as mother
join mother.mate as mate
left join mother.kittens as offspr
assuming that the class Family has an appropriate constructor.



http://www.hibernate.org/hib_docs/refer ... hql-select

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


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.