Reputation: 19892
I'm using the Hibernate JPA 2 Metamodel Generator to generate metamodel classes for my @Entity
model classes so I can use typesafe criteria queries.
Due to the use of Generics in some of my model clases, some of the generated metamodel classes cause compiler warnings about raw types. The generated code seems to function just fine, but I want to suppress these inconsequential warnings in the generated code.
Is there anyway I can get the metamodel generator to either:
@SuppressWarnings("rawtypes")
annotation to each of the generated metamodel classes?package-info.java
file to each metamodel package to which would contain the same annotationEither solution would be acceptable. Is either possible?
Upvotes: 4
Views: 707
Reputation: 122
With the last metamodel generator (1.2) you can add @SuppressWarnings("all") to the generated metamodel classes. You cannot specify the suppress type, but, as all the warnings are useless if you are not going to change the generated classes, it could suit your needs.
You must set a processor option with -AaddSuppressWarningsAnnotation=true, you can find the documentation here:
http://docs.jboss.org/hibernate/jpamodelgen/1.2/reference/en-US/html/chapter-usage.html#d0e349
Upvotes: 1