JPA + BeanFieldGroup

Hi,

Is it possible to use the automatic bean validation of BeanFieldGroup with JPA?

I have a predefined form layout with my fields and my current problem is that my table containing all my data is not updated when a bean is modified. Since my table container is a JPAContainer, it is not directly linked with the beans. The table items are JPAContainerItem and I must extract the object to create a BeanItem to feed th BeanFieldGroup.

Please advise

Hi,

(Automatic) bean validation works perfectly for me, see for example
this demo app
, but on the other hand I’m practically never using JPAContainer.

Instead of using the JPAContainerItem in your forms, I’d suggest to try to get raw entity, wrap that into BeanItem and then pass that for the form. That should work perfectly. The “downside” is that you’ll have to save the entity “manually”, but I suggest to do that via service layer (e.g. EJB/Spring Data) anyways.

cheers,
matti

Thanks for the advice