[
http://opensource.atlassian.com/projects/hibernate/browse/HV-533?page=com...
]
Hardy Ferentschik commented on HV-533:
--------------------------------------
You are mixing annotation from two different domains. _@Column_ comes from the JPA
specification and _@Digits_ from the Bean Validation spec. In particular the latter does
not know anything about the former.
The javadocs for _@Digits_ is quite clear imo:
{quote}
/**
* @return maximum number of integral digits accepted for this number.
*/
int integer();
/**
* @return maximum number of fractional digits accepted for this number.
*/
int fraction();
{quote}
@Digits.fraction should allow negative values
---------------------------------------------
Key: HV-533
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HV-533
Project: Hibernate Validator
Issue Type: Bug
Components: documentation, validators
Affects Versions: 4.2.0.Final
Reporter: Devesh Parekh
There are really two bugs here:
1. The documentation for @Digits.fraction does not concretely say what should happen for
negative values, but the 1.0 final spec defines the correct behavior on page 133 with the
equation @Column.precision = @Digits.integer + @Digits.fraction. This suggests that
@Digits.fraction should be negative when @Column.scale is negative.
2. The implementation throws an IllegalArgumentException when @Digits.fraction is
negative.
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira