HbnContainer join table

Hello,
I have a table Branch, it have ManyToMany relation to table User. I.e. Branch can have many Users and User can be in many Branches.
I am modify HbnContainer to use criterias (http://vaadin.com/forum/-/message_boards/message/170963), so, I can do data filtering. Please, help me figure out how can I get Users by branch id in ManyToMany relation.

SQL: select * from User inner join Branch_User Where id=users_id and branches_id=%s

Hi,

I’m not sure that it is possible with hbncontainer, cause you will need to create sub criteria (but you can provide only criterion to container).
You can try to play with Restrictions.sqlRestriction, but i’m not sure that it is a good option (and that it’s even possible with it).
Or you can ask about it on hibernate forum (how to build such query with only criterions (Restrictions))

Maybe it will be better idea to try http://vaadin.com/directory#addon/lazy-query-container, it should bring you more freedom for query definition.

Thanks for reply.