Annotation type not applicable error in packageinfo in Java 8

Annotation type not applicable error in package-info in Java 8

I use SqlResultSetMappings annotations in package-info.java. This code was working in Java 6 but does not work in Java 8 as SqlResultSetMappings use Javax Persistence API.

@SqlResultSetMappings({
@SqlResultSetMapping(name = “mapping”,
columns = {
ColumnResult(name = “id”),
ColumnResult(name = “display”)
})
})

Is there a work around? Thanks

How could this have worked with Java 6? The annotations SqlResultSetMappings and SqlResultSetMapping both define @Target({TYPE}), so it is illegal to put the annotations on anything other than a type, regardless of the used Java version.