JPAContainer and nested properties problem

I have entity ExchangeRate {date, currencyFrom, rate} . Entity currencyFrom has properties code and Name. I add it to container addNestedContainerProperty(“currencyFrom.code”);
it works without problem and code is displayed in vaadin table.

Now I create BeanValidationForm and add this field to it. It crash because BeanValidationValidator it try to find getter for currencyFrom.code and looks for method getCurrencyFrom.code inside ExchangeRate.

  1. What’s wrong? How can I use nested property field on form to display some information.

  2. It’s possible to modify ExchangeRate nested properties?

  1. BeanValidationForm assumes all the properties are in the main bean class - it does not know anything about JPAContainer or nested properties. Note that JSR-303 bean validation annotations are accessed directly from the bean class, not through the container.

To get around this, you must give the correct bean class to each BeanValidationValidator created - either override BeanValidationForm.addField() and give the correct bean class to BVV.addValidator(), or use BVV directly instead of using the helper class BeanValidationForm.

  1. It should be possible (at least with suitable cascade settings) - but if you have separate EntityProviders for the class of the nested instances, they are not notified of changes if you only save the nested entity as a part of the main entity.

Thank you. Override of BeanValidationForm.addField() works fine.

Can you help me with and - it is probably problem with BeenValidator too. I can’t find solution for several days :frowning: Kind regards V.

Could you tell me how you overrided it, I tried but no succes.