Class JPAManyToManyProcessor

java.lang.Object
org.castor.cpa.jpa.processors.BaseJPAAnnotationProcessor
org.castor.cpa.jpa.processors.fieldprocessors.JPAManyToManyProcessor
All Implemented Interfaces:
AnnotationProcessor, TargetAwareAnnotationProcessor

public class JPAManyToManyProcessor extends BaseJPAAnnotationProcessor
Processes the JPA annotation ManyToMany. This is the most complex processor. After this processor is done, we know, that we have 2 fields that have a well defined relation to each other. This processor checks for target entities, relationship owning and checks that there is at least one join definition for this relation. After this processor is done, all 5 relation linked methods (and of cource the Many2Many related ones) of JPAFieldNature will return valid values.
Version:
05.02.2009
Author:
Peter Schmidt
  • Constructor Details

    • JPAManyToManyProcessor

      public JPAManyToManyProcessor()
  • Method Details

    • forAnnotationClass

      public Class<? extends Annotation> forAnnotationClass()
      Returns for which Annotation this processor is meant.
      Returns:
      the Class for which this processor is meant
      See Also:
    • processAnnotation

      public <I extends BaseNature, A extends Annotation> boolean processAnnotation(I info, A annotation, AnnotatedElement target) throws AnnotationTargetException
      The processing action of this processor. If an annotation is given which is not supported false is returned.
      Parameters:
      info - the Info class that should be filled with the information read
      annotation - the annotation to process
      target - the target (Field, Class, etc.) of the given annotation
      Returns:
      true, if the annotation was processed successfully, false if not
      Throws:
      AnnotationTargetException - if an annotation is used in a context that is not valid.
      See Also: