Hello,
I am having a problem understanding the best method to find if a user is in a group.
I have a User that contains a many2many List of Sections which contains a one2many List of Categories.
I am trying to create a query that will find all the users that belong to a Category which is the pojo of Categories. I know what the id of the Category is.
I am using the following Query:
Code:
Query query = mySession.createQuery("from UserBean as user where ? in elements(user.sections.categories)");
query.setParameter(0, categories);
findBeans = (ArrayList) query.list();
My question is, how do I pass id into the query? Because what I have now isn't working. Any help would be great!
---Jason