TwinColSelect and JPAContainer

Hi!

Can you please help me point out my misunderstanding. I can’t fill initial values in TwinColSelect to work with JPA entities. Maybe i am missing something simple but i will be very thankful if you can point it out.

[code]
@Entity
@Table(name=“weekend”)
public class WeekendDO implements Serializable {
@JoinTable(name = “weekend_object”,
joinColumns = @JoinColumn(name = “weekend_id”),
inverseJoinColumns = @JoinColumn(name = “object_id”)
)
@OneToMany
@OrderColumn(name=“sorter”)
private List objects = null;
}

In ObjectDO there is no link to WeekendDO list.

JPAContainer availableObjects = JPAContainerFactory.make(ObjectDO.class, JPAUtils.getEntityManager());
final WeekendDO weekend = JPAUtils.getEntityManager().find(WeekendDO.class, 3102);
TwinColSelect objectsSelect = new TwinColSelect(“SomeCaption”);
objectsSelect.setItemCaptionMode(AbstractSelect.ItemCaptionMode.PROPERTY);
objectsSelect.setItemCaptionPropertyId(“name”);
objectsSelect.setLeftColumnCaption(“Available”);
objectsSelect.setRightColumnCaption(“Selected”);
objectsSelect.setContainerDataSource(availableObjects);

    BeanFieldGroup<WeekendDO> binder = new BeanFieldGroup<WeekendDO>(WeekendDO.class);
    binder.setItemDataSource(weekend);
    binder.setBuffered(false);
    binder.bind(objectsSelect, "objects");
    
    root.addComponent(objectsSelect);

[/code]I am using Vaadin 7.1.8 and JPAContainer 3.1.1 but the prefilled (right list) is empty. The TwinColSelect tries to put there an Integers (i debug it) but i’d (and JPA too) like to see there an ObjectDO’s. Is it possible to do and that is the right way for it?

Thank you.