-->
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: adding alias to projection breaks the where clause
PostPosted: Tue Apr 08, 2008 7:30 pm 
Newbie

Joined: Sun Mar 30, 2008 10:15 pm
Posts: 18
Hello,

I'm observing that once a projection has an alias my where clause (restrictions) break the query:

Would you please help me get passed this issue...

here is how to produce it.
Criteria c = ...CreateCriteria(demo.Cat.class);
c.setProjection(Projections.projectionList()
.add(Projections.groupProperty("color")));
c.add(Restrictions.eq("color", keyColor));
c.list()

produces:

select this_.color as y0_ from cats this_ where this_.color=? group by this_.color

Now if I add an alias to my projection it will fail...

c.setProjection(Projections.projectionList()
.add(Projections.groupProperty("color"),"color")); //ALIAS
c.add(Restrictions.eq("color", keyColor));
c.list()

produces:
select this_.color as y0_ from cats this_ where y0_=? group by this_.color

Note that it is doing y0_=? instead of this_.color=?

I need the alias so that I can do result transformation...is there a way I can get the alias to work with the resitriction?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 09, 2008 9:03 am 
Newbie

Joined: Sun Mar 30, 2008 10:15 pm
Posts: 18
it is realted to this issue:
http://opensource.atlassian.com/project ... se/HHH-817

It is not clear is this issue fixed now?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 09, 2008 9:03 am 
Newbie

Joined: Sun Mar 30, 2008 10:15 pm
Posts: 18
it is realted to this issue:
http://opensource.atlassian.com/project ... se/HHH-817

It is not clear is this issue fixed now?


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.