When using hibernate-validator-annotation-processor (5.4.0) at compile time, I have the following errors :
[INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] .../Invoice.java:[17,5] The annotation @Currency is disallowed for this data type. [ERROR] .../Invoice.java:[16,5] The annotation @DecimalMax is disallowed for this data type. [INFO] 2 errors
I used this annotations in a POJO :
@DecimalMax("1000.00") @Currency("EUR") private MonetaryAmount totalAmount;
I tested it with Java Money API (JSR-354) and Java 8 : <dependency> <groupId>javax.money</groupId> <artifactId>money-api</artifactId> <version>1.0.1</version> </dependency> I suppose that the constraint has not been registered in the class org.hibernate.validator.ap.util.TypeNames.HibernateValidatorTypes and org.hibernate.validator.ap.util.ConstraintHelper. |