org.datanucleus.jpa.metadata
Class JPAAnnotationReader

java.lang.Object
  extended by org.datanucleus.metadata.annotations.AbstractAnnotationReader
      extended by org.datanucleus.jpa.metadata.JPAAnnotationReader
All Implemented Interfaces:
AnnotationReader

public class JPAAnnotationReader
extends AbstractAnnotationReader

Implementation for Annotation Reader for JDK 1.5 annotations using JPA's definition. This reader also accepts certain DataNucleus extensions where the JPA annotations don't provide full definition of the data required.


Field Summary
 
Fields inherited from class org.datanucleus.metadata.annotations.AbstractAnnotationReader
LOCALISER, mgr, supportedPackages
 
Constructor Summary
JPAAnnotationReader(org.datanucleus.metadata.MetaDataManager mgr)
          Constructor.
 
Method Summary
protected  boolean isClassPersistenceCapable(java.lang.Class cls)
          Check if class is persistence capable, by looking at annotations
protected  org.datanucleus.metadata.AbstractClassMetaData processClassAnnotations(org.datanucleus.metadata.PackageMetaData pmd, java.lang.Class cls, 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, Member member, AnnotationObject[] annotations, boolean propertyAccessor)
          Convenience method to process the annotations for a field/property.
protected  void processMethodAnnotations(org.datanucleus.metadata.AbstractClassMetaData cmd, java.lang.reflect.Method method)
          Method to take the passed in outline ClassMetaData and process the annotations for method adding any necessary MetaData to the ClassMetaData.
 
Methods inherited from class org.datanucleus.metadata.annotations.AbstractAnnotationReader
getAnnotationObjectsForAnnotations, getClassAnnotationsForClass, getFieldAnnotationsForClass, getJavaBeanAccessorAnnotationsForClass, getMetaDataForClass, getMethodAnnotationsForClass, getSupportedAnnotationPackages, isSupportedAnnotation, setSupportedAnnotationPackages
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JPAAnnotationReader

public JPAAnnotationReader(org.datanucleus.metadata.MetaDataManager mgr)
Constructor.

Parameters:
mgr - MetaData manager
Method Detail

processClassAnnotations

protected org.datanucleus.metadata.AbstractClassMetaData processClassAnnotations(org.datanucleus.metadata.PackageMetaData pmd,
                                                                                 java.lang.Class cls,
                                                                                 AnnotationObject[] annotations,
                                                                                 org.datanucleus.ClassLoaderResolver clr)
Method to process the "class" level annotations and create the outline ClassMetaData object

Specified by:
processClassAnnotations in class AbstractAnnotationReader
Parameters:
pmd - Parent PackageMetaData
cls - The class
annotations - Annotations for this class
clr - ClassLoader resolver
Returns:
The ClassMetaData (or null if no annotations)

processMemberAnnotations

protected org.datanucleus.metadata.AbstractMemberMetaData processMemberAnnotations(org.datanucleus.metadata.AbstractClassMetaData cmd,
                                                                                   Member member,
                                                                                   AnnotationObject[] annotations,
                                                                                   boolean propertyAccessor)
Convenience method to process the annotations for a field/property. The passed annotations may have been specified on the field or on a getter method.

Specified by:
processMemberAnnotations in class AbstractAnnotationReader
Parameters:
cmd - The ClassMetaData to update
member - The field/property
annotations - The annotations for the field/property
propertyAccessor - if has persistent properties
Returns:
The FieldMetaData/PropertyMetaData that was added (if any)

processMethodAnnotations

protected void processMethodAnnotations(org.datanucleus.metadata.AbstractClassMetaData cmd,
                                        java.lang.reflect.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 AbstractAnnotationReader
Parameters:
cmd - The ClassMetaData (to be updated)
method - The method

isClassPersistenceCapable

protected boolean isClassPersistenceCapable(java.lang.Class cls)
Check if class is persistence capable, by looking at annotations

Parameters:
cls - the Class
Returns:
true if the class has Entity annotation


Copyright © 2009. All Rights Reserved.