org.apache.openjpa.persistence.jdbc
Class AnnotationPersistenceMappingParser

java.lang.Object
  extended by org.apache.openjpa.persistence.AnnotationPersistenceMetaDataParser
      extended by org.apache.openjpa.persistence.jdbc.AnnotationPersistenceMappingParser
All Implemented Interfaces:
MetaDataModes

public class AnnotationPersistenceMappingParser
extends AnnotationPersistenceMetaDataParser

Persistence annotation mapping parser.

Author:
Pinaki Poddar, Steve Kim, Abe White

Field Summary
protected static int FALSE
           
protected static int TRUE
           
 
Fields inherited from interface org.apache.openjpa.meta.MetaDataModes
MODE_ANN_MAPPING, MODE_MAPPING, MODE_MAPPING_INIT, MODE_META, MODE_NONE, MODE_QUERY
 
Constructor Summary
AnnotationPersistenceMappingParser(JDBCConfiguration conf)
           
 
Method Summary
protected  boolean handleUnknownClassMappingAnnotation(ClassMapping cls, Annotation anno)
          Allow subclasses to handle unknown annotations.
protected  boolean handleUnknownMemberMappingAnnotation(FieldMapping fm, Annotation anno)
          Allow subclasses to handle unknown annotations.
protected  boolean handleUnknownPackageMappingAnnotation(Package pkg, Annotation anno)
          Allow subclasses to handle unknown annotations.
protected  void parseClassMappingAnnotations(ClassMetaData meta)
          Parse class mapping annotations.
protected  void parseColumns(FieldMapping fm, Column... pcols)
          Parse @Column(s).
protected  void parseContainerTable(FieldMapping fm, ContainerTable ctbl)
          Parse @ContainerTable.
protected  void parseElementJoinColumns(FieldMapping fm, ElementJoinColumn... joins)
          Parse @ElementJoinColumn(s).
protected  void parseForeignKey(MappingInfo info, String name, boolean enabled, boolean deferred, ForeignKeyAction deleteAction, ForeignKeyAction updateAction)
          Set foreign key data on the given mapping info.
protected  void parseIndex(MappingInfo info, String name, boolean enabled, boolean unique)
          Set index data on the given mapping info.
protected  void parseLobMapping(FieldMetaData fmd)
          Setup the field as a LOB mapping.
protected  void parseMemberMappingAnnotations(FieldMetaData fmd)
          Parse member mapping components.
protected  void parsePackageMappingAnnotations(Package pkg)
          Parse package mapping annotations.
protected  void parseXJoinColumns(FieldMapping fm, MappingInfo info, boolean secondaryAllowed, XJoinColumn... joins)
          Parse given @XJoinColumn annotations.
protected  void setColumns(FieldMapping fm, MappingInfo info, List<Column> cols, int unique)
          Set the given columns as the columns for fm.
protected static int toPolymorphicConstant(NonpolymorphicType val)
          Return the ValueMapping POLY_* constant for the given enum value.
 
Methods inherited from class org.apache.openjpa.persistence.AnnotationPersistenceMetaDataParser
clear, getConfiguration, getEnvClassLoader, getLog, getMappingOverride, getMode, getRepository, getSourceFile, handleUnknownClassAnnotation, handleUnknownMemberAnnotation, handleUnknownPackageAnnotation, isMappingMode, isMappingOverrideMode, isMetaDataMode, isQueryMode, parse, parseCallbackMethods, setEnvClassLoader, setMappingOverride, setMode, setMode, setRepository
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRUE

protected static final int TRUE
See Also:
Constant Field Values

FALSE

protected static final int FALSE
See Also:
Constant Field Values
Constructor Detail

AnnotationPersistenceMappingParser

public AnnotationPersistenceMappingParser(JDBCConfiguration conf)
Method Detail

parsePackageMappingAnnotations

protected void parsePackageMappingAnnotations(Package pkg)
Description copied from class: AnnotationPersistenceMetaDataParser
Parse package mapping annotations.

Overrides:
parsePackageMappingAnnotations in class AnnotationPersistenceMetaDataParser

handleUnknownPackageMappingAnnotation

protected boolean handleUnknownPackageMappingAnnotation(Package pkg,
                                                        Annotation anno)
Allow subclasses to handle unknown annotations.


parseClassMappingAnnotations

protected void parseClassMappingAnnotations(ClassMetaData meta)
Description copied from class: AnnotationPersistenceMetaDataParser
Parse class mapping annotations.

Overrides:
parseClassMappingAnnotations in class AnnotationPersistenceMetaDataParser

handleUnknownClassMappingAnnotation

protected boolean handleUnknownClassMappingAnnotation(ClassMapping cls,
                                                      Annotation anno)
Allow subclasses to handle unknown annotations.


parseForeignKey

protected void parseForeignKey(MappingInfo info,
                               String name,
                               boolean enabled,
                               boolean deferred,
                               ForeignKeyAction deleteAction,
                               ForeignKeyAction updateAction)
Set foreign key data on the given mapping info.


parseIndex

protected void parseIndex(MappingInfo info,
                          String name,
                          boolean enabled,
                          boolean unique)
Set index data on the given mapping info.


parseLobMapping

protected void parseLobMapping(FieldMetaData fmd)
Description copied from class: AnnotationPersistenceMetaDataParser
Setup the field as a LOB mapping.

Overrides:
parseLobMapping in class AnnotationPersistenceMetaDataParser

parseMemberMappingAnnotations

protected void parseMemberMappingAnnotations(FieldMetaData fmd)
Description copied from class: AnnotationPersistenceMetaDataParser
Parse member mapping components.

Overrides:
parseMemberMappingAnnotations in class AnnotationPersistenceMetaDataParser

handleUnknownMemberMappingAnnotation

protected boolean handleUnknownMemberMappingAnnotation(FieldMapping fm,
                                                       Annotation anno)
Allow subclasses to handle unknown annotations.


toPolymorphicConstant

protected static int toPolymorphicConstant(NonpolymorphicType val)
Return the ValueMapping POLY_* constant for the given enum value.


parseColumns

protected void parseColumns(FieldMapping fm,
                            Column... pcols)
Parse @Column(s).


setColumns

protected void setColumns(FieldMapping fm,
                          MappingInfo info,
                          List<Column> cols,
                          int unique)
Set the given columns as the columns for fm.

Parameters:
unique - bitwise combination of TRUE and FALSE for the unique attribute of each column

parseXJoinColumns

protected void parseXJoinColumns(FieldMapping fm,
                                 MappingInfo info,
                                 boolean secondaryAllowed,
                                 XJoinColumn... joins)
Parse given @XJoinColumn annotations.


parseContainerTable

protected void parseContainerTable(FieldMapping fm,
                                   ContainerTable ctbl)
Parse @ContainerTable.


parseElementJoinColumns

protected void parseElementJoinColumns(FieldMapping fm,
                                       ElementJoinColumn... joins)
Parse @ElementJoinColumn(s).



Copyright © 2006-2007 Apache Software Foundation. All Rights Reserved.