-->
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: Named Query - results incorrect results
PostPosted: Mon May 14, 2007 8:05 pm 
Newbie

Joined: Mon May 14, 2007 7:55 pm
Posts: 1
Location: CA
Hi,
I have a simple query which runs correctly using SQL PLUS and TOAD but on executing thru Hibernate messes up the data.

Query is like this:

select distinct lv1.lov_value as {lovValues.lovValue} ,
lv2.lov_value as {lovValues.actualValue},
1 as {lovValues.displayOrder}
from lov_values lv1, lov_values lv2, lov l
where lv1.parent_lov_value_id = lv2.id
and lv1.lov_id = l.id
and l.lov_name = 'SUB_AREA'
and lv1.app_id in ( select app_id from app_org where org_id = :org_id)
ORDER BY lv2.lov_value, lv1.lov_value

where org_id is input value.

Code is
crtList = session.getNamedQuery("GenSrSubAreaQuery2")
.setString("org_id","999901").list();


I am not sure what the problem is? It returns correct number of rows but changes the data on order by.

Any help is appreciated?


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.