Hi all,
I have the following HQL query:
Code:
select distinct budget.clubType
from Budget budget
where budget.season.budgetYear = :budgetYear
and budget.season.seasonCode = :seasonCode
(The query is actually more complex, so I'm abbreviating here for simplicity's sake.)
The query works and does what I need. But now I would like to use the same query to retrieve clubTypes from different tables, so I need to supply the entity specified in the FROM clause dynamically. Hibernate query parser complains if I do "from :entity ent", so I guess that's not allowed. I suspect I'll need to switch to using the Criteria API instead of HQL to implement that, but I'm not sure how to do this.
Any help will be appreciated.
Eugene
P.S. I'm using Hibernate 3.1.2.