Hi.
I have 2 tables:
groupInfo table
================================================
group_name, sort_direction(ASC, DESC), description
groupData table
================================================
short_name, long_name, group_name, sort_order
I want to make 1 database call.
The user will provide the sort direction. however if the sort_direction is not provided I want to use the value that is set up for that group in the database.
I am able to achieve this using the following sql statement (notice the order by subselect)
Code:
select short_name, long_name, sort_direction
from groupInfo gd, groupData gdg
where gd.group_name='StreetType' and gd.GROUP_NAME=gdg.GROUP_NAME
order by
(select short_name || sort_direction from groupInfo where group_name='StreetType');
Is there a way to create this order by subselect statement using a Criteria object?
groupValues.addOrder(....)?
Thanks
M