-->
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.  [ 1 post ] 
Author Message
 Post subject: Get property NAMES when using Query.Scroll
PostPosted: Mon Feb 02, 2004 10:17 am 
Beginner
Beginner

Joined: Thu Jan 22, 2004 6:16 am
Posts: 40
Location: Luxembourg
For the moment, I have the following code :

sql = "SELECT i.companyCode, i.fundSponsor FROM abpro.beans.Funds2 i WHERE i.fundCode = 'B91A' AND i.classCode = 'A'";

// create an HQL statement and execute
hql = session.createQuery(sql);
results = hql.scroll();
results.beforeFirst();
while(results.next())
{
System.out.println(results.get(0) + " - " + results.get(1));
}

With this code, I get the VALUE of the properties. But how do I get the property NAMES, in this case <companyCode> and <fundSponsor> without hardcoding it ? I.e I would like to have something like

<propertyName> : <propertyValue>
<propertyName> : <propertyValue>
.
.

Thanks in advance.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.