-->
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.  [ 5 posts ] 
Author Message
 Post subject: Query witch returns more than one class
PostPosted: Thu Nov 13, 2003 7:13 am 
Pro
Pro

Joined: Wed Oct 08, 2003 10:31 am
Posts: 247
Let's say I wanted to do the following query:

List res = session.find("select foo, bar " +
"from eg.Foo foo, eg.Bar bar " +
"where foo.startDate = bar.date"
);

What's in "res"?

Is res.get(0) a list of classes of "eg.Foo" and res.get(1) a list of classes of "eg.Bar"?

I'm having problems returning the two lists of eg.Foo and eg.Bar in the same query.

Is this the way to do it?

Please help.


Top
 Profile  
 
 Post subject: Re: Query witch returns more than one class
PostPosted: Thu Nov 13, 2003 7:57 am 
Pro
Pro

Joined: Wed Oct 08, 2003 10:31 am
Posts: 247
nerotnt wrote:
Let's say I wanted to do the following query:

List res = session.find("select foo, bar " +
"from eg.Foo foo, eg.Bar bar " +
"where foo.startDate = bar.date"
);

What's in "res"?

Is res.get(0) a list of classes of "eg.Foo" and res.get(1) a list of classes of "eg.Bar"?

I'm having problems returning the two lists of eg.Foo and eg.Bar in the same query.

Is this the way to do it?

Please help.


I've resolved it. No need for help.
Thanks.


Top
 Profile  
 
 Post subject: Re: Query witch returns more than one class
PostPosted: Mon Nov 17, 2003 8:09 am 
Newbie

Joined: Mon Nov 17, 2003 7:35 am
Posts: 5
nerotnt wrote:

I've resolved it. No need for help.
Thanks.


Hi,

I have the same problem. Can you show me how do you did?

Thanks


Top
 Profile  
 
 Post subject: Re: Query witch returns more than one class
PostPosted: Mon Nov 17, 2003 8:47 am 
Pro
Pro

Joined: Wed Oct 08, 2003 10:31 am
Posts: 247
acz wrote:
nerotnt wrote:

I've resolved it. No need for help.
Thanks.


Hi,

I have the same problem. Can you show me how do you did?

Thanks


Each row is of type Object[].
So you only need to get each array element and cast to the class you want.


Top
 Profile  
 
 Post subject: Re: Query witch returns more than one class
PostPosted: Mon Nov 17, 2003 8:58 am 
Newbie

Joined: Mon Nov 17, 2003 7:35 am
Posts: 5
nerotnt wrote:
Each row is of type Object[].
So you only need to get each array element and cast to the class you want.


thanks


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