Sample Needed for ComboBox in Table for part of composite key


I’m looking for a good example that shows how to do the following with Vaadin:

Using JPA to access the following tables:

users - has a unique numeric serial key, then username string.
rules - has a unique numeric serial key, then rulename string.
user-roles has a composite key of the users-key and rules-key, which is unique

now, show in a vaadin app:

a table on the left with the list of users.
a table on the right with the list of associated user-roles in the form of a list of combo-box controls that show per row, only the role name.


selecting a row in the table of users causes the table on the right to show only the user-rules rows for that user.

allow the user to add rows to the user-rules table by choosing the role from the combo box which shows roles, which of course, get persisted to the database.

this will demonstrate:

  1. the combo box in the user-roles list showing the visible values obtained via a database (JPA) container, while the current value comes from the user-roles table proper.

  2. addition/removal of rows that have composite keys, with one of the values being identified via the role combo box.