Reputation: 2581
I have Vaadin application backed by JPA. Components in this application are bound to bean properties (via standalone EL implementation). Some of components are bound to external objects (or their fields), linked by @OneToOne, @OneToMany, @ManyToOne and @ManyToMany annotations. The binding performed by implementing com.vaadin.data.Property and setting it as DataSources of components.
The question is: will lazy loading work in "Property"ies if component will be refreshed somehow (by vaadin's ajaxes) after the form is served to browser?
Upvotes: 3
Views: 1839
Reputation: 6543
If you have set your PersistanceContext on your EntityManager to PersistenceContextType.EXTENDED then your entities will handle this and hence also vaadin. If you dont have it then you will have to load them manualy.
@PersistenceContext(unitName = "yourname", type=PersistenceContextType.EXTENDED)
private EntityManager entityManager;
Upvotes: 2