I\'m a newbie to Hibernate.
I have an Item POJO which contains a Set consisting of labels. The labels are contained on anothe
The member of command in the HQL is reserved for the use of non-primitive objects. There are two things you can do. You can either create a SQLQuery as follows:
SQLQuery sQuery = session.createSQLQuery("select *
from item_table it
inner join label_table lt
where it.id = lt.item_id
and lt.label = 'hello'");
sQuery.list();
Or you can create a class called Label and do the following in your HQL:
from Item item, Label label
where label member of item.labels
and label.label = 'hello'
Hope this helps :)