I have a JPAContainer filled with group entities (which contains properties like group name, number of users in the group, etc). I want users to be able to view a table containing a list of all the groups they belong to.
I got this to work by doing groups.addContainerFilter(new Like("users.email", user.getEmail()));
(Just realized using their ID would have made more sense, but that's not the point), but now I'm having the issue where if there are two users viewing the table at the same time, the listed groups will change to the new user's groups.
For example:
- Player A is viewing his groups
- Player B goes to view his groups
- Player A's view refreshes
- Player A is now viewing player B's groups
I feel like I'm missing an obvious solution. I thought of just having a separate container backing the table, and then adding all the entities resulting from the filter on groups to the table's new container, but that seems inefficient.
Is it not possible to somehow have the same JPAContainer be filtered differently for different users?