Table JPAContainer with info obtained by Hibernate

Hi everyone!

I’m a new developer of vaadin and I’m having a lot of problems with this framework. I am in a project with vaadin+Spring+Hibernate with an Oracle database. I’ve developed a simple example with two domains, User and Context, the relationship between them are Many to Many and my domains are like these:

@Table(name = “SAT20_USERS”)
public class Users {
private Long user_id;
private Long niu;
private String nom;
private String admin;
private String mail;
private Set contexts = new HashSet(0);

@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = “SAT20_USER_CTX”, joinColumns = { @JoinColumn(name = “USER_ID”, nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = “CTXT_ID”, nullable = false, updatable = false) })
public Set getContexts() {
return contexts;
public void setContexts(Set contexts) {
this.contexts = contexts;

@Table(name = “SAT20_CTXT”)
public class Context {

private Long id;
private String name;
private Area area;
private String code;
private Set<Users> users = new HashSet<Users>(0);

@SequenceGenerator(name="context_generator", sequenceName="SAT20_SQ_CTXT")
@Column(name = "CTXT_ID", unique = true, nullable = false)
public Long getId() {
    return id;

@ManyToMany(fetch = FetchType.LAZY, mappedBy = "contexts")
public Set<Users> getUsers() {
    return this.users;

[/code]As you can see exists an intermediate table called “SAT20_USER_CTX” to connect “SAT20_CTX” and “SAT20_USER” (for simulate Many to Many relationship). My problem is that when I try to print a table with all the users I have an error in line: table_1.setContainerDataSource(persons);

com.vaadin.ui.Table$CacheUpdateException: Error during Table cache update The way that I try to print the User list is this:

public class UserManagement extends CustomComponent {
    private static final long serialVersionUID = 1L;

    private VerticalLayout mainLayout;

    private VerticalLayout verticalLayout_3;

    private VerticalLayout verticalLayout_2;

    private GridLayout gridLayout_2;

    private CheckBox checkBox_admin;

    private Label label_admin;

    private Label label_mail_resultat;

    private Label label_mail;

    private Label label_nom_resultat;

    private Label label_nom;

    private TextField textField_1;

    private Label label_NIU;

    private HorizontalLayout horizontalLayout_1;

    private Button button_elimina;

    private Button button_guardar;

    private Button button_nou;

    private Table table_1;

    private final Logger log=Logger.getLogger(this.getClass().getName());
    public static final String PERSISTENCE_UNIT = "sat20";
    private JPAContainer<Users> persons;
    private String textFilter;
    private TextField searchField;

    public UserManagement(Context context, final Window mainWindow) {
         HorizontalLayout toolbar = new HorizontalLayout();
         searchField = new TextField();
         searchField.setInputPrompt("Search by name");
         searchField.addListener(new TextChangeListener() {        
            private static final long serialVersionUID = 1L;

            public void textChange(TextChangeEvent event) {
                 textFilter = event.getText();
        toolbar.setExpandRatio(searchField, 1);
        toolbar.setComponentAlignment(searchField, Alignment.TOP_RIGHT);
        persons = JPAContainerFactory.make(Users.class, PERSISTENCE_UNIT);
        persons.sort(new String[]{"nom"}, new boolean[]


        table_1.setColumnHeaders(new String[] { "MAIL", "USER_ID", "ADMIN", "ID", "NOM"});

I’m pretty sure that it’s something related with the relationship Many to Many between Users and Context because if I remove it the problem is solved, any idea? please help me!

Thanks in advance!

Could be related with this thread!/thread/2305723

Help me please, it’s very important!