I have a JSF 2.0 application that I would like to start adding validators for. A basic overview of the architecture of the app is as follows.
I have Managed Backing Beans that contain instances of my JPA annotated classes and EJB's. The EJB's are responsible for accessing the database transactionally. The JPA annotated classes are valuebound to my facelets (and use the EJB's for db access).
I would like to potentially use Bean validation and write custom constraints, however this will mean I have to add those constraints to my JPA annotated classes. This seems to me like it is violating my separation of concerns. (Mixing presentation/validation with the JPA annotated classes/DAOs) Is it better to not use Bean validation in this case? Is my structure flawed? Is there a preferred way of doing this that I do not know about?
Thanks!