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?
|