Hi,
I’m still a noob with Vaadin and with Hibernate, but I saw strange behaviour using the Vaadin table with HbnContainer.
We have are using a onetoone and a onetomany relation, and we use the vaadin table to show the “grnadmother of all” side of the relations (Class Rsu) using an HbnContainer. When setting the fetchtype to EAGER of this relation, the Vaadin table shows not all objects, but most of the time the same object multiple times (exactly the total number of the items in the container). By dumping the container content itself (in a log) it contains the correct and expected objects (all different Rsu objects).
Class Rsu...
@OneToOne( mappedBy = "rsu", cascade = CascadeType.ALL)
@JoinColumn(name = "TRAILDATAID", nullable = false, updatable = true,
insertable = true)
private TrailData trailData;
Class TrailData....
@OneToMany(mappedBy = "traildata", fetch=FetchType.EAGER, cascade = CascadeType.ALL)
private Set<Trail> trails = new HashSet<Trail>(0);
By removing the EAGER fetchtype, the vaadin table shows the correct and expected values (Rsu’s). Can anyone explain what is happening here?