[hibernate-issues] [Hibernate-JIRA] Updated: (BVAL-192) Add 'exclusive' boolean attribute to @DecimalMin/@DecimalMax constraints

Hardy Ferentschik (JIRA) noreply at atlassian.com
Mon Oct 18 11:01:47 EDT 2010


     [ http://opensource.atlassian.com/projects/hibernate/browse/BVAL-192?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hardy Ferentschik updated BVAL-192:
-----------------------------------

    Description: 
Hi, may I suggest to enhance {{@DecimalMin}}/{{@DecimalMax}} constraints with additional _exclusive_ boolean attribute? This would allow to define a constraints like:

{code}
// a positive non-zero decimal number
@DecimalMin(value = "0.0", exclusive = true)
{code}

{code}
// a negative non-zero decimal number
@DecimalMax(value = "0.0", exclusive = true)
{code}

This makes sense when dealing with decimal numbers where one might want to allow a number regardless of the precision.
{{@DecimalMin("0.0001")}} vs. {{@DecimalMin("0.000000001")}}, etc.

To maintain backward compatibility, default value for new _exclusive_ boolean attribute should be {{false}}

  was:
Hi, may I suggest to enhance @DecimalMin/@DecimalMax constraints with additional 'exclusive' boolean attribute? This would allow to define a constraints like:

a positive non-zero decimal number
@DecimalMin(value = "0.0", exclusive = true)

a negative non-zero decimal number
@DecimalMax(value = "0.0", exclusive = true)

This makes sense when dealing with decimal numbers where one might want to allow a number regardless of the precision.
@DecimalMin("0.0001") vs. @DecimalMin("0.000000001"), etc.

To maintain backward compatibility, default value for new 'exclusive' boolean attribute should be false.


> Add 'exclusive' boolean attribute to @DecimalMin/@DecimalMax constraints
> ------------------------------------------------------------------------
>
>                 Key: BVAL-192
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/BVAL-192
>             Project: Bean Validation
>          Issue Type: Improvement
>          Components: spec-general
>    Affects Versions: 1.0 final
>         Environment: Hibernate Validator 4.0.0.GA
>            Reporter: Jaro Kuruc
>         Attachments: patch.patch
>
>
> Hi, may I suggest to enhance {{@DecimalMin}}/{{@DecimalMax}} constraints with additional _exclusive_ boolean attribute? This would allow to define a constraints like:
> {code}
> // a positive non-zero decimal number
> @DecimalMin(value = "0.0", exclusive = true)
> {code}
> {code}
> // a negative non-zero decimal number
> @DecimalMax(value = "0.0", exclusive = true)
> {code}
> This makes sense when dealing with decimal numbers where one might want to allow a number regardless of the precision.
> {{@DecimalMin("0.0001")}} vs. {{@DecimalMin("0.000000001")}}, etc.
> To maintain backward compatibility, default value for new _exclusive_ boolean attribute should be {{false}}

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