How do I suppress primitive type warnings in the generated canonical metadata class?
I am using hibernate JPA 2 metamodel generator to generate metamodel classes for my @ entity model class, so I can query using type safety standards
Due to the use of generics in some of my model branches, some generated metamodel classes will cause the compiler to warn about primitive types The generated code seems to work properly, but I want to suppress these insignificant warnings in the generated code
Anyway, I can let the metamodel generator:
>Add @ suppresswarnings ("rawtypes") comments for each generated metamodel class? > Or package info Java files are added to each metamodel package that contains the same annotations
Both solutions are acceptable Or is it possible?
Solution
Using the last metamodel generator (1.2), you can add @ suppresswarnings ("all") to the generated metamodel class You cannot specify the suppression type, but if you do not intend to change the generated class, all warnings are useless and can meet your needs
You must set the processor option with - aaddresswarningsannotation = true. You can find the document here:
http://docs.jboss.org/hibernate/jpamodelgen/1.2/reference/en-US/html/chapter-usage.html#d0e349