-->
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: Question about CreateSQLQuery and SetResultTransformer
PostPosted: Tue Dec 04, 2007 12:56 am 
Newbie

Joined: Mon Dec 03, 2007 10:50 pm
Posts: 6
I have NHibernate 1.2.0GA. I have checked the source for 1.2.1, and can't find any changes relevant to this error.

I am trying to use .CreateSQLQuery and an AliasToBean transformer. The following code works for me:

Quote:
ISQLQuery qry = BusinessContext.Instance.Dao.CurrentSession.CreateSQLQuery("select getdate() as Prop1");
qry.AddScalar("Prop1", NHibernateUtil.Date);
qry.SetResultTransformer(NHibernate.Transform.Transformers.AliasToBean(typeof(Test1)));
IList list = qry.List();


However, from reading the documentation, I did not expect to have to need the .AddScalar() call. Did I mis-read the documentation, or is there an issue here, or... ?

Thanks!
--randy


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.