Class JDOAnnotationReader

  • All Implemented Interfaces:
    org.datanucleus.metadata.annotations.AnnotationReader

    public class JDOAnnotationReader
    extends org.datanucleus.metadata.annotations.AbstractAnnotationReader
    Implementation for Annotation Reader for java annotations using the JDO definition.
    • Field Summary

      • Fields inherited from class org.datanucleus.metadata.annotations.AbstractAnnotationReader

        mmgr, supportedDuplicateAnnotations, supportedPackages
    • Constructor Summary

      Constructors 
      Constructor Description
      JDOAnnotationReader​(org.datanucleus.metadata.MetaDataManager mgr)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected boolean doesClassHaveNamedQueries​(org.datanucleus.metadata.annotations.AnnotationObject[] annotations)
      Check if class has Query annotations (for classes that are not persistable but provide named query definitions.
      protected org.datanucleus.metadata.annotations.AnnotationObject isClassPersistable​(org.datanucleus.metadata.annotations.AnnotationObject[] annotations)
      Check if a class is persistable, by looking at its annotations.
      protected boolean isClassPersistenceAware​(org.datanucleus.metadata.annotations.AnnotationObject[] annotations)
      Check if class is persistence aware, by looking at annotations.
      protected org.datanucleus.metadata.AbstractClassMetaData processClassAnnotations​(org.datanucleus.metadata.PackageMetaData pmd, Class cls, org.datanucleus.metadata.annotations.AnnotationObject[] annotations, org.datanucleus.ClassLoaderResolver clr)
      Method to process the "class" level annotations and create the outline ClassMetaData object.
      protected org.datanucleus.metadata.AbstractMemberMetaData processMemberAnnotations​(org.datanucleus.metadata.AbstractClassMetaData cmd, org.datanucleus.metadata.annotations.Member member, org.datanucleus.metadata.annotations.AnnotationObject[] annotations)
      Convenience method to process the annotations for a field/property.
      protected void processMethodAnnotations​(org.datanucleus.metadata.AbstractClassMetaData cmd, Method method)
      Method to take the passed in outline ClassMetaData and process the annotations for method adding any necessary MetaData to the ClassMetaData.
      protected void processNamedQueries​(org.datanucleus.metadata.AbstractClassMetaData cmd, Class cls, org.datanucleus.metadata.annotations.AnnotationObject[] annotations)
      Convenience method to process @Queries, @Query.
      • Methods inherited from class org.datanucleus.metadata.annotations.AbstractAnnotationReader

        addSupportedDuplicateAnnotations, getAnnotationObjectsForAnnotations, getClassAnnotationsForClass, getFieldAnnotationsForClass, getJavaBeanAccessorAnnotationsForClass, getMetaDataForClass, getSupportedAnnotationPackages, isPersistenceContext, isSupportedAnnotation, setSupportedAnnotationPackages
    • Constructor Detail

      • JDOAnnotationReader

        public JDOAnnotationReader​(org.datanucleus.metadata.MetaDataManager mgr)
        Constructor.
        Parameters:
        mgr - MetaData manager
    • Method Detail

      • processClassAnnotations

        protected org.datanucleus.metadata.AbstractClassMetaData processClassAnnotations​(org.datanucleus.metadata.PackageMetaData pmd,
                                                                                         Class cls,
                                                                                         org.datanucleus.metadata.annotations.AnnotationObject[] annotations,
                                                                                         org.datanucleus.ClassLoaderResolver clr)
        Method to process the "class" level annotations and create the outline ClassMetaData object. Supports classes annotated with @PersistenceCapable, classes annotated with @PersistenceAware, and classes which have neither of those but have @Queries or @Query.
        Specified by:
        processClassAnnotations in class org.datanucleus.metadata.annotations.AbstractAnnotationReader
        Parameters:
        pmd - Parent PackageMetaData
        cls - The class
        annotations - Annotations for this class
        clr - ClassLoader resolver
        Returns:
        The ClassMetaData/InterfaceMetaData (or null if no annotations)
      • processNamedQueries

        protected void processNamedQueries​(org.datanucleus.metadata.AbstractClassMetaData cmd,
                                           Class cls,
                                           org.datanucleus.metadata.annotations.AnnotationObject[] annotations)
        Convenience method to process @Queries, @Query.
        Parameters:
        cmd - Metadata for the class, to which any queries will be added
        cls - Class that the named queries are registered against
        annotations - Annotations specified on the class
      • processMemberAnnotations

        protected org.datanucleus.metadata.AbstractMemberMetaData processMemberAnnotations​(org.datanucleus.metadata.AbstractClassMetaData cmd,
                                                                                           org.datanucleus.metadata.annotations.Member member,
                                                                                           org.datanucleus.metadata.annotations.AnnotationObject[] annotations)
        Convenience method to process the annotations for a field/property. The passed annotations may have been specified on the field or on the getter methods.
        Specified by:
        processMemberAnnotations in class org.datanucleus.metadata.annotations.AbstractAnnotationReader
        Parameters:
        cmd - The ClassMetaData/InterfaceMetaData to update
        member - The field/property
        annotations - Annotations for the field/property
        Returns:
        The FieldMetaData/PropertyMetaData that was added (if any)
      • processMethodAnnotations

        protected void processMethodAnnotations​(org.datanucleus.metadata.AbstractClassMetaData cmd,
                                                Method method)
        Method to take the passed in outline ClassMetaData and process the annotations for method adding any necessary MetaData to the ClassMetaData.
        Specified by:
        processMethodAnnotations in class org.datanucleus.metadata.annotations.AbstractAnnotationReader
        Parameters:
        cmd - The ClassMetaData/InterfaceMetaData (to be updated)
        method - The method
      • isClassPersistable

        protected org.datanucleus.metadata.annotations.AnnotationObject isClassPersistable​(org.datanucleus.metadata.annotations.AnnotationObject[] annotations)
        Check if a class is persistable, by looking at its annotations.
        Parameters:
        annotations - Annotations for the class
        Returns:
        The annotationObject for PersistenceCapable
      • isClassPersistenceAware

        protected boolean isClassPersistenceAware​(org.datanucleus.metadata.annotations.AnnotationObject[] annotations)
        Check if class is persistence aware, by looking at annotations.
        Parameters:
        annotations - Annotations for the class
        Returns:
        true if the class has @PersistenceAware
      • doesClassHaveNamedQueries

        protected boolean doesClassHaveNamedQueries​(org.datanucleus.metadata.annotations.AnnotationObject[] annotations)
        Check if class has Query annotations (for classes that are not persistable but provide named query definitions.
        Parameters:
        annotations - Annotations for the class
        Returns:
        true if the class has Named query annotations