Metamodel generation doesn't work with target TYPE_USE annotated fields, e.g. with validations from bean validation 2.0.
For example this class {code:java}
@Entity public class TestEntity { @Id private String id;
@MySize private byte[] bytes;
@Target({FIELD, TYPE_USE}) @Retention(RUNTIME) @Constraint(validatedBy = {}) @Size(max = 16) public @interface MySize { String message() default "{javax.validation.constraints.Size.message}";
Class<?>[] groups() default {};
Class<? extends Payload>[] payload() default {}; } } {code}
generates the following metamodel
{code:java}
@Generated(value = "org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor") @StaticMetamodel(TestEntity.class) public abstract class TestEntity_ {
public static volatile SingularAttribute<TestEntity, MySize :: byte)[]> bytes; public static volatile SingularAttribute<TestEntity, String> id;
} {code} however the following is expected
{code:java}
@Generated(value = "org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor") @StaticMetamodel(TestEntity.class) public abstract class TestEntity_ {
public static volatile SingularAttribute<TestEntity, byte[]> bytes; public static volatile SingularAttribute<TestEntity, String> id;
} {code} |
|