Hi.
I am having problems with returning objects from the nested HQL queries. Here is an example:
select distinct activity2, activity2.acttype, studact.status
from StudAct as studact, Activity as activity2 "
where studact.studid = 5
and studact.actid = activity2.actid
order by activity2.acttype.resumealways DESC,
studact.status DESC,
activity2.acttype.sort ASC
The problem is that the returned result cannot be casted to the Activity[]. If I am trying to use the above query as a nested query, I get the error saying "unknown alias activity2". Here is the nested query that I am trying to run:
select activity2 from (
// here goes the query above
)
What is the right way to select objects from nested queries?
Thanks.
|