[hibernate-issues] [Hibernate-JIRA] Updated: (HV-297) The use of buildConstraintViolationWithTemplate whilst using jsr303 validation to validation a class fails to alter the default error message
Hardy Ferentschik (JIRA)
noreply at atlassian.com
Thu Mar 18 13:17:34 EDT 2010
[ http://opensource.atlassian.com/projects/hibernate/browse/HV-297?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hardy Ferentschik updated HV-297:
---------------------------------
Fix Version/s: 4.1.0-Beta-1
Component/s: (was: annotation-processor)
engine
There is indeed a problem. However, you can easily prevent it removing the {{@ReportAsSingleViolation}} annotation. This annotation only makes sense in the case of composed constraints.
Arguably it should be ignored in this test setup.
> The use of buildConstraintViolationWithTemplate whilst using jsr303 validation to validation a class fails to alter the default error message
> ---------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: HV-297
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-297
> Project: Hibernate Validator
> Issue Type: Bug
> Components: engine
> Affects Versions: 4.0.2.GA
> Environment: Hibernate version 4.02GA Java 1.6 Solaris and Mac OSX
> Reporter: Chris March
> Assignee: Hardy Ferentschik
> Fix For: 4.1.0-Beta-1
>
> Attachments: TestProject.zip
>
>
> When creating a custom Validator to validate a class, when overriding the isValid method it is supposed to be possible to return a custom error message as opposed to the default error message, by calling methods on the passed in ConstraintValidatorContext object.
> This appears simply not to work
> I have attached an example Junit test case which shows the problem happening
> I have included all the associated jars in the zip as I was unsure if that was the correct thing to do or not.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list