org.apache.cayenne.jpa.conf
Class EntityMapAnnotationLoader

java.lang.Object
  extended by org.apache.cayenne.jpa.conf.EntityMapAnnotationLoader

public class EntityMapAnnotationLoader
extends Object

JpaEntityMap loader that reads mapping information from the class annotations per JPA specification.

Specification Documentation, persistence_1_0.xsd, "class" element.

[Each managed class] should be annotated with either \@Entity, \@Embeddable or \@MappedSuperclass

Author:
Andrus Adamchik

Field Summary
protected  org.apache.cayenne.jpa.conf.AnnotationProcessorFactory callbackProcessorFactory
           
protected  org.apache.cayenne.jpa.conf.AnnotationProcessorFactory classProcessorFactory
           
protected  EntityMapLoaderContext context
           
protected  Comparator<Annotation> memberAnnotationsSorter
           
protected  org.apache.cayenne.jpa.conf.AnnotationProcessorFactory memberProcessorFactory
           
protected  Comparator<Annotation> typeAnnotationsSorter
           
 
Constructor Summary
EntityMapAnnotationLoader(EntityMapLoaderContext context)
           
 
Method Summary
protected  void applyEntityCallbackAnnotations(Method method, AnnotationProcessorStack stack)
           
protected  boolean applyMemberAnnotations(JpaPropertyDescriptor property, AnnotationProcessorStack stack)
          Processes member annotations, returning true if at least one JPA annotation was found.
protected  Collection<Method> getEntityCallbacks(Class managedClass)
          Returns a collection of methods that match an 'entity callback" pattern, i.e.
 void loadClassMapping(Class managedClass)
          Processes annotations of a single Java class, loading ORM mapping information to the provided entity map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

protected EntityMapLoaderContext context

typeAnnotationsSorter

protected Comparator<Annotation> typeAnnotationsSorter

memberAnnotationsSorter

protected Comparator<Annotation> memberAnnotationsSorter

classProcessorFactory

protected org.apache.cayenne.jpa.conf.AnnotationProcessorFactory classProcessorFactory

memberProcessorFactory

protected org.apache.cayenne.jpa.conf.AnnotationProcessorFactory memberProcessorFactory

callbackProcessorFactory

protected org.apache.cayenne.jpa.conf.AnnotationProcessorFactory callbackProcessorFactory
Constructor Detail

EntityMapAnnotationLoader

public EntityMapAnnotationLoader(EntityMapLoaderContext context)
Method Detail

loadClassMapping

public void loadClassMapping(Class managedClass)
                      throws JpaProviderException
Processes annotations of a single Java class, loading ORM mapping information to the provided entity map.

Throws:
JpaProviderException

applyMemberAnnotations

protected boolean applyMemberAnnotations(JpaPropertyDescriptor property,
                                         AnnotationProcessorStack stack)
Processes member annotations, returning true if at least one JPA annotation was found.


applyEntityCallbackAnnotations

protected void applyEntityCallbackAnnotations(Method method,
                                              AnnotationProcessorStack stack)

getEntityCallbacks

protected Collection<Method> getEntityCallbacks(Class managedClass)
Returns a collection of methods that match an 'entity callback" pattern, i.e. "void ()".



Copyright © 2001-2007 Apache Cayenne. All Rights Reserved.