DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
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

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}'}

subes made changes - 04/May/11 09:50 PM
Field Original Value New Value
Attachment [ 11441 ]
Andy Jefferson made changes - 06/May/11 10:44 AM
Attachment [ 11441 ]
Andy Jefferson made changes - 06/May/11 10:44 AM
Affects Version/s 3.0.0.release [ 11072 ]
Priority Major [ 3 ] Trivial [ 5 ]
Andy Jefferson added a comment - 06/May/11 10:45 AM
SVN trunk adds a message to the exception

Andy Jefferson made changes - 06/May/11 10:45 AM
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 3.0.0.m4 [ 11227 ]
Resolution Fixed [ 1 ]
Andy Jefferson made changes - 14/Jun/11 12:27 PM
Status Resolved [ 5 ] Closed [ 6 ]