arquillian / continuous-enterprise-development

Testable Solutions for Modern Applications
http://continuousdev.org/
116 stars 150 forks source link

How to handle multi layer validation #28

Closed aslakknutsen closed 11 years ago

aslakknutsen commented 11 years ago

Validation on JPA level Validation on REST level ?

JPA conference.duration.start|end == start|end in REST

Convert Representation to JPA then validate, JPA returns 'duration' should not be null. Representation only knows about start/end (which maps to a Duration).

aslakknutsen commented 11 years ago

Skip Validation in the JPA level, keep it pure Java via IllegalArguments

Keep validation in REST Representation where we control how the JPA objects are updated/created