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: HQL object[] property names?
PostPosted: Mon Aug 14, 2006 1:33 pm 
Newbie

Joined: Mon Aug 14, 2006 1:21 pm
Posts: 1
Hello to everybody!
I have what i think is a simple question, but i can't find the answer anywhere else... so i thought i would post a new topic here.
Thing is... when you make a select query with hql like

select customer.Id, customer.Name from Customer customer

it returns an object array.

I just wanted to know if there's any chance to tell NHibernate to bring information about the Property Names along with the data from the table.
For instance, if i want to populate a DropDownList with the result of this query it'd be really usefull to write something like

myDDL.DataTextField = "Id";
myDDL.DataValueField = "Name";
myDDL.DataBind();

but i can't refer to them as such, given that I have a object[]...
I would really love to skip a DataTable population... Ok, I know it doesn't make the performance decrease that much when working with small databases, but i have large ones. And customers love fast systems...

Thanks in advance for answering!!
Cheers,
Alejandro =)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 14, 2006 2:31 pm 
Newbie

Joined: Mon Jan 09, 2006 11:12 am
Posts: 6
try this

String[] fieldNames = query.getReturnAliases();


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 19, 2007 3:29 pm 
Regular
Regular

Joined: Tue Dec 02, 2003 6:25 pm
Posts: 61
Location: Dallas, TX
Did this work?

I can't find this method anywhere on any of the query implementations, and although it exists on IQueryTranslator, it doesn't appear to be implemented on Hql.Classic.QueryTranslator.


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.