org.hibernate.PropertyValueException is a nice animal, containing a lot of useful info:
entityName
propertyName
so instead of doing yourself the validation on all the properties to be persisted, you can delegate Hibernate.
The problem with Hibernate is that it's a fail-fast validation: the first invalid property (null or referencing an non existing entity) will throw an exception.
If you want to capture ALL the validation errors, then you need to do it individually testing each property.
No comments:
Post a Comment
comments where you are promoting your business will be marked as SPAM :o)