Class AnnotationPersistenceMappingParser
- java.lang.Object
-
- org.apache.openjpa.persistence.AnnotationPersistenceMetaDataParser
-
- 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
Fields Modifier and Type Field Description protected static int
FALSE
protected static int
TRUE
-
Fields inherited from class org.apache.openjpa.persistence.AnnotationPersistenceMetaDataParser
_cls, _stack
-
Fields inherited from interface org.apache.openjpa.meta.MetaDataModes
MODE_ALL, MODE_ANN_MAPPING, MODE_MAPPING, MODE_MAPPING_INIT, MODE_META, MODE_NONE, MODE_QUERY
-
-
Constructor Summary
Constructors Constructor Description AnnotationPersistenceMappingParser(JDBCConfiguration conf)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FieldMapping
getAttributeOverrideField(java.lang.String attrName, FieldMapping fm, ClassMapping embed)
static java.lang.Class<?>
getEmbeddedClassType(FieldMapping fm, java.lang.String attrName)
static FieldMapping
getEmbeddedFieldMapping(FieldMapping fm, java.lang.String attrName)
static FieldMapping
getEmbeddedFieldMapping(FieldMapping fm, java.lang.String attrName, boolean mustExist)
static ClassMapping
getEmbeddedMapping(ValueMapping val)
static ClassMapping
getEmbeddedMapping(ValueMapping val, boolean createNew)
protected boolean
handleUnknownClassMappingAnnotation(ClassMapping cls, java.lang.annotation.Annotation anno)
Allow subclasses to handle unknown annotations.protected boolean
handleUnknownMemberMappingAnnotation(FieldMapping fm, java.lang.annotation.Annotation anno)
Allow subclasses to handle unknown annotations.protected boolean
handleUnknownPackageMappingAnnotation(java.lang.Package pkg, java.lang.annotation.Annotation anno)
Allow subclasses to handle unknown annotations.protected java.lang.String
normalizeCatalogName(java.lang.String catName)
protected java.lang.String
normalizeSchemaName(java.lang.String schName)
protected java.lang.String
normalizeSequenceName(java.lang.String seqName)
protected void
parseClassMappingAnnotations(ClassMetaData meta)
Parse class mapping annotations.protected void
parseCollectionTable(FieldMapping fm, jakarta.persistence.CollectionTable ctbl)
Parse @CollectionTable.protected void
parseColumns(FieldMapping fm, jakarta.persistence.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, java.lang.String name, boolean enabled, boolean deferred, ForeignKeyAction deleteAction, ForeignKeyAction updateAction)
Set foreign key data on the given mapping info.protected void
parseIndex(MappingInfo info, java.lang.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
parseMapKeyColumn(FieldMapping fm, jakarta.persistence.MapKeyColumn anno)
Parse @MapKeyColumn.protected void
parseMemberMappingAnnotations(FieldMetaData fmd)
Parse member mapping components.protected void
parsePackageMappingAnnotations(java.lang.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, java.util.List<Column> cols, int unique)
Set the given columns as the columns forfm
.protected void
setMapKeyColumn(FieldMapping fm, MappingInfo info, Column col, int unique)
Set the given map key column as the map key column forfm
.protected void
setTargetIdentifier(Column col, java.lang.String refColumnName)
protected static int
toPolymorphicConstant(NonpolymorphicType val)
Return theValueMapping
POLY_*
constant for the given enum value.-
Methods inherited from class org.apache.openjpa.persistence.AnnotationPersistenceMetaDataParser
addHints, addSourceInfo, clear, getConfiguration, getEnvClassLoader, getLog, getMappingOverride, getMode, getRepository, getSourceFile, handleUnknownClassAnnotation, handleUnknownMemberAnnotation, handleUnknownPackageAnnotation, isMappingMode, isMappingOverrideMode, isMetaDataMode, isQueryMode, parse, parseCallbackMethods, setEnvClassLoader, setMappingOverride, setMode, setMode, setRepository, toKernelParameterMode, toOverrideType
-
-
-
-
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(java.lang.Package pkg)
Description copied from class:AnnotationPersistenceMetaDataParser
Parse package mapping annotations.- Overrides:
parsePackageMappingAnnotations
in classAnnotationPersistenceMetaDataParser
-
handleUnknownPackageMappingAnnotation
protected boolean handleUnknownPackageMappingAnnotation(java.lang.Package pkg, java.lang.annotation.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 classAnnotationPersistenceMetaDataParser
-
handleUnknownClassMappingAnnotation
protected boolean handleUnknownClassMappingAnnotation(ClassMapping cls, java.lang.annotation.Annotation anno)
Allow subclasses to handle unknown annotations.
-
parseForeignKey
protected void parseForeignKey(MappingInfo info, java.lang.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, java.lang.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 classAnnotationPersistenceMetaDataParser
-
parseMemberMappingAnnotations
protected void parseMemberMappingAnnotations(FieldMetaData fmd)
Description copied from class:AnnotationPersistenceMetaDataParser
Parse member mapping components.- Overrides:
parseMemberMappingAnnotations
in classAnnotationPersistenceMetaDataParser
-
handleUnknownMemberMappingAnnotation
protected boolean handleUnknownMemberMappingAnnotation(FieldMapping fm, java.lang.annotation.Annotation anno)
Allow subclasses to handle unknown annotations.
-
toPolymorphicConstant
protected static int toPolymorphicConstant(NonpolymorphicType val)
Return theValueMapping
POLY_*
constant for the given enum value.
-
getEmbeddedFieldMapping
public static FieldMapping getEmbeddedFieldMapping(FieldMapping fm, java.lang.String attrName)
-
getEmbeddedFieldMapping
public static FieldMapping getEmbeddedFieldMapping(FieldMapping fm, java.lang.String attrName, boolean mustExist)
-
getEmbeddedClassType
public static java.lang.Class<?> getEmbeddedClassType(FieldMapping fm, java.lang.String attrName)
-
getEmbeddedMapping
public static ClassMapping getEmbeddedMapping(ValueMapping val, boolean createNew)
-
getEmbeddedMapping
public static ClassMapping getEmbeddedMapping(ValueMapping val)
-
getAttributeOverrideField
public static FieldMapping getAttributeOverrideField(java.lang.String attrName, FieldMapping fm, ClassMapping embed)
-
parseColumns
protected void parseColumns(FieldMapping fm, jakarta.persistence.Column... pcols)
Parse @Column(s).
-
setColumns
protected void setColumns(FieldMapping fm, MappingInfo info, java.util.List<Column> cols, int unique)
Set the given columns as the columns forfm
.- Parameters:
unique
- bitwise combination of TRUE and FALSE for the unique attribute of each column
-
setTargetIdentifier
protected void setTargetIdentifier(Column col, java.lang.String refColumnName)
-
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.
-
parseCollectionTable
protected void parseCollectionTable(FieldMapping fm, jakarta.persistence.CollectionTable ctbl)
Parse @CollectionTable.
-
parseElementJoinColumns
protected void parseElementJoinColumns(FieldMapping fm, ElementJoinColumn... joins)
Parse @ElementJoinColumn(s).
-
parseMapKeyColumn
protected void parseMapKeyColumn(FieldMapping fm, jakarta.persistence.MapKeyColumn anno)
Parse @MapKeyColumn.
-
setMapKeyColumn
protected void setMapKeyColumn(FieldMapping fm, MappingInfo info, Column col, int unique)
Set the given map key column as the map key column forfm
.- Parameters:
unique
- bitwise combination of TRUE and FALSE for the unique attribute of the column
-
normalizeSequenceName
protected java.lang.String normalizeSequenceName(java.lang.String seqName)
- Overrides:
normalizeSequenceName
in classAnnotationPersistenceMetaDataParser
-
normalizeSchemaName
protected java.lang.String normalizeSchemaName(java.lang.String schName)
- Overrides:
normalizeSchemaName
in classAnnotationPersistenceMetaDataParser
-
normalizeCatalogName
protected java.lang.String normalizeCatalogName(java.lang.String catName)
- Overrides:
normalizeCatalogName
in classAnnotationPersistenceMetaDataParser
-
-