[Hibernate-JIRA] Moved: (HV-21) Base class validations are not over-ridden
by Emmanuel Bernard (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HV-21?page=com.... ]
Emmanuel Bernard moved ANN-344 to HV-21:
----------------------------------------
Affects Version/s: (was: 3.2.0.cr1)
Component/s: (was: validator)
Key: HV-21 (was: ANN-344)
Project: Hibernate Validator (was: Hibernate Annotations)
> Base class validations are not over-ridden
> ------------------------------------------
>
> Key: HV-21
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-21
> Project: Hibernate Validator
> Issue Type: Improvement
> Environment: hibernate 3.2 cr2
> Reporter: Aseel Abbas
>
> When the same validation annotation is applied to an over-riding method in a subclass the expected behaviour is that the validation annotation in the base class is over-ridden. Currently, both validations are executed. This severely limits the usability of the package for domain models where inheritance is used.
> The problem also occurs with over-riding interfaces.
> For example:
> class A {
> @Length (min = 0, max = 32)
> Integer getFoo() {
> return foo;
> }
> }
> class B extends A
> {
> @Length (min = 15, max = 20)
> Integer getFoo() {
> return super.getFoo();
> }
> }
> In this case validating an instance of class B which has a foo value of 100 will result in two error messages: "foo must be between 15 and 20" and "foo must be between 0 and 32".
--
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....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 7 months
[Hibernate-JIRA] Moved: (HV-19) Consider higher level validations, such as email, URL, credit card, etc.
by Emmanuel Bernard (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HV-19?page=com.... ]
Emmanuel Bernard moved ANN-150 to HV-19:
----------------------------------------
Affects Version/s: (was: 3.1beta6)
Component/s: (was: validator)
Key: HV-19 (was: ANN-150)
Project: Hibernate Validator (was: Hibernate Annotations)
> Consider higher level validations, such as email, URL, credit card, etc.
> ------------------------------------------------------------------------
>
> Key: HV-19
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-19
> Project: Hibernate Validator
> Issue Type: New Feature
> Reporter: Ted Bergeron
> Priority: Minor
>
> I was looking at the release notes for commons validator 1.2 http://wiki.apache.org/jakarta-commons/ValidatorVersion120 and wondered if the higher level constructs fit the design goals of hibernate validator.
> They have email, URL, Credit card and ISBN. These could all be handled via @Pattern with regex matching a constant declared somewhere.
> Would it be desirable to have Hibernate supply the values for these constants? Such as:
> @Pattern(type="email") or @Pattern(regex=org.hibernate.validator.Pattern.EMAIL) or @Email
> Email and URL are global patterns. This probably wouldn't work for something like phone number which is locale sensitive.
--
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....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 7 months