@Entity isn tmark with the @Documented annotation.
@Target(TYPE)
@Retention(RUNTIME)
public @interface Entity {
如果你试着@javax。 反之,请见JavaDoc,因为它标有@Documented。
@Target({ METHOD, CONSTRUCTOR, FIELD })
@Retention(RUNTIME)
@Documented
public @interface Inject {}
The @Documented annotation with JavaDoc:
/**
* Indicates that annotations with a type are to be documented by javadoc
* and similar tools by default. This type should be used to annotate the
* declarations of types whose annotations affect the use of annotated
* elements by their clients. If a type declaration is annotated with
* Documented, its annotations become part of the public API
* of the annotated elements.
*
* @author Joshua Bloch
* @version 1.6, 11/17/05
* @since 1.5
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.ANNOTATION_TYPE)
public @interface Documented {
}
解决办法是进口 Java源,而不是进口 Java。 然后,它将按照你的期望开展工作。