-->
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.  [ 5 posts ] 
Author Message
 Post subject: SetResultTransformer method missing?!
PostPosted: Thu Nov 09, 2006 6:03 am 
Beginner
Beginner

Joined: Wed May 31, 2006 9:24 am
Posts: 22
Hi there, I have been reading this thread http://forum.hibernate.org/viewtopic.php?t=965456&highlight=getnamedquery, and I wanted to implement the same kind of solution.

However, I do not have a SetResultTransformer method against my IQuery object. I have downloaded the source code, and a solution search for 'SetResultTransformer' only shows this method in ICriteria.

I am a little confused! How can I acheive the same result as the linked post above?

AHA, Ben


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 10, 2006 6:57 am 
Beginner
Beginner

Joined: Wed May 31, 2006 9:24 am
Posts: 22
Maybe I should be a little clearer in my question. Sergey gave a solution in the post I referenced previously which was this:

Code:
IQuery query = session.GetNamedQuery("...").SetResultTransformer(Transformers.AliasToBean(typeof(Company)));


However, I do not have a SetResultTransformer method available if I copy this code in my project. Having downloaded the NHibernate source, when I look in the IQuery interface, there is no SetResultTransformer method.

This looks like exactly the solution I need, but I am unable to try it because it is not available! I am pretty confused as it has been directly referenced by Sergey and in the post I linked to the author was obviously able to use it!!

Cheers, Ben


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 10, 2006 7:22 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
You don't say which version you are using. SetResultTransformer was introduced in 1.2.0.Beta1 (and will actually work correctly in Beta2).


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 10, 2006 7:31 am 
Beginner
Beginner

Joined: Wed May 31, 2006 9:24 am
Posts: 22
Sorry - I downloaded 1.0.3 yesterday.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 10, 2006 7:35 am 
Beginner
Beginner

Joined: Wed May 31, 2006 9:24 am
Posts: 22
Aha! Seems I've been getting confused over version numbers!

I will go and investigate 1.2.0.Beta1|2. Thanks :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.