-->
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: How to identify whats returned by a named query?
PostPosted: Tue Jun 28, 2005 2:32 pm 
Newbie

Joined: Sun Mar 06, 2005 5:41 am
Posts: 13
Hello,

I'm using hibernate 3.

Suppose I do the following named query:

<query name="getAllProductsWithColors">
<![CDATA[
select prod, color.Id, color.Name, pi
from com.thelabllc.cognition.orm.model.Product as prod
inner join prod.color as color
left outer join prod.purchaseItems as pi
]]>
</query>

Is there a way to look in the list returned and know that a certain array element is a certain column or object? Sort of like the names of the columns being in a resultset.

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 28, 2005 4:51 pm 
Newbie

Joined: Sun Mar 06, 2005 5:41 am
Posts: 13
For a bit more clarity on the issue:

Suppose a named query retuns this List of java objects:

Product - OM Class
String
Integer
Integer

Is there some way to know what column either of the Integers are mapped to? or if its a column at all?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 28, 2005 4:51 pm 
Newbie

Joined: Sun Mar 06, 2005 5:41 am
Posts: 13
Sorry that should a List containing an array of objects.


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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.