I'm wondering if it's possible to have something like bean validation in UI (for example in jsf or primefaces) to be implemented or executed when saving an entity on backend. For example I have a job that import customers from 1 system to another. Of course I'll do the parsing and saving of the records, but the problem is the data might not match. Some values might be longer than the field can hold.
Aside from checking the fields manually one by one, is there an efficient way to address this?
If you are using JPA for persistence, then event based validation of entities (on life cycle events like pre-persist, pre-update and pre-delete) is per default enabled in a EE 6 environment. All you need to do is to start placing constraints on your entities (or add the right xml configuration files to configure constraints via XML).