Uploaded image for project: 'Hibernate Validator'
  1. Hibernate Validator
  2. HV-1252

Annotation processor is not aware of new constraint @Currency and validators for type MonetaryAmount

    Details

      Description

      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.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: