-->
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: Problem while using ResultTransformer
PostPosted: Thu Apr 02, 2009 9:06 am 
Newbie

Joined: Fri Dec 12, 2008 8:41 am
Posts: 3
I'm retriving few columns using

ProjectionList projectionList = Projections.projectionList();
projectionList.add(Projections.property(propertyName), value);
criteria.setProjection(projectionList);

And i'm using a ResultTransformerClass also to transform my criteria result

criteria.setResultTransformer(Transformers.aliasToBean(TestResult.class));


This works fine if i dont have a "where" condition added.

But if i need to filter out only those records whose name like 'te%' ,Then

Hibernate generates query like:
select data as y0_, age as y1_, name as y2_ Employee
where y2_ ilike 'te%' ;

As in the where condition it's taking the alias name("y2_") the query is failing
saying "y2_" column Not found.

How can we explicitly say Hibernate not to use alias name in where condition
or to use the alias name that we specify?


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.