Issue Details (XML | Word | Printable)

Key: NUCJPA-130
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Trivial Trivial
Assignee: Unassigned
Reporter: subes
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
DataNucleus API JPA

make ConstrainsViolationExceptions verbose

Created: 04/May/11 09:50 PM   Updated: 14/Jun/11 12:27 PM   Resolved: 06/May/11 10:45 AM
Component/s: API
Affects Version/s: 2.1.7, 3.0.0.m1, 3.0.0.m2, 3.0.0.m3
Fix Version/s: 3.0.0.m4

Severity: Development


 Description  « Hide
It would be nice if DataNucleus would populate ConstrainsViolationExceptions with meaningful messages on creation. Thus making the debugging process easier for developers in the rare case when this exception occurs during development or production.

See the hibernate implementation extracted from org.hibernate.cfg.beanvalidation.BeanValidationEventListener.validate() which is attached.
org.datanucleus.api.jpa.beanvalidation.BeanValidatorHandler.validate() would be in need of modification there.

Sample output generated by hibernates implementation:
javax.validation.ConstraintViolationException: Validation failed for classes [de.invesdwin.gemeinsam.persistenz.TestEntity] during persist time for groups [javax.validation.groups.Default, ]
List of constraint violations:[
ConstraintViolationImpl{interpolatedMessage='kann nicht null sein', propertyPath=name, rootBeanClass=class de.invesdwin.gemeinsam.persistenz.TestEntity, messageTemplate='{javax.validation.constraints.NotNull.message}'}
]



Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson added a comment - 06/May/11 10:45 AM
SVN trunk adds a message to the exception