Regular |
|
Joined: Mon Jan 05, 2009 6:42 pm Posts: 99 Location: IL
|
Hi Natalie,
what is the database you are trying to use?
Can you post your DAO code? I think there is a minor possible syntax error in the HQL projection..
I would first test the DAO with this query:-
<query name="GetNetworkUsersExceptTheseIds" cacheable="false">
<![CDATA[
from User as u
inner join u.userNetworks as un
inner join un.network as n
where n.id in (:nw_id)
order by u.lastName asc]]>
</query>
and see if this works.And then extend as:-
<query name="GetNetworkUsersExceptTheseIds" cacheable="false">
<![CDATA[
from User as u
inner join u.userNetworks as un
inner join un.network as n
where n.id in (:nw_id)
and u.id not in(
select u1.id
from User u1
inner join userRoles as ur
inner join ur.role as rt
where u.id = u1.id
and rt.sort_order >= :role_sort_order)
order by u.lastName asc]]>
</query>
In both the cases you will get List<User> instances.
Hope this helps,
Latha.
|
|