-->
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.  [ 3 posts ] 
Author Message
 Post subject: What kind of objects do inner joins return?
PostPosted: Wed Jun 27, 2012 11:11 am 
Newbie

Joined: Wed Jun 27, 2012 10:49 am
Posts: 3
Hello,

I am using the following HSQL query in a Spring project

select e.id, c.firstName, c.lastName, c.email, max(e.creationDate)
from Enquiry as e inner join e.theCustomer as c
group by e.id, c.firstName, c.lastName, c.email,
e creationDate.

which returns a list of java objects. Unfortunately, I am not sure
what those objects are: Enquiries, Customers, or other objects?

How can I tell?

Many thanks.

Philroc


Top
 Profile  
 
 Post subject: Re: What kind of objects do inner joins return?
PostPosted: Wed Jun 27, 2012 12:05 pm 
Newbie

Joined: Wed Apr 08, 2009 6:45 am
Posts: 5
The fact that it is an inner join is irrelevant.

The select clause tells you what objects are being returned:

select e.id, c.firstName, c.lastName, c.email, max(e.creationDate)

Each row of the result set will be an array of objects, which will be typed according to the properties you have specified in the clause above.

eg, e.id might be an Integer, c.firstName will probably be a String, etc.

HTH

Jordan.


Top
 Profile  
 
 Post subject: Re: What kind of objects do inner joins return?
PostPosted: Wed Jun 27, 2012 12:55 pm 
Newbie

Joined: Wed Jun 27, 2012 10:49 am
Posts: 3
Many thanks, gusgorman. That's exactly what I needed to know.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.