axismundi wrote:
I don't know your schema in detail.
But everything you need for HQL you can find here:
http://www.hibernate.org/hib_docs/v3/re ... ryhql.htmlif that does not fit your needs use session.createSQLQuery() for plain sql
thanx for reference, I read all Hibernate-reference, but I cannot find nothing for my help.
now, I am trying filters in hbm.xml
<filter-def name="myFilter">
<filter-param name="myFilterParam" type="string"/>
</filter-def>
problem is:
I have Employee, and employee can have got bonus for year, so one Employee has some bonuses (one for one year)
Now I need select all Employees with their bonus which have or have not bonus for the year.
Employee has id as private key
Bonus has private key employee_id and year.
in sql is
select e.id,b.value from Employee e left outer join Bonus on e.id=b.employee_id AND b.year=2005;
in HQL ????
select e,b from Employee e left join e.bonuses b where b.year=2005;
but the selects is not the same.