public class MetadataDescriptor extends Object
Constructor and Description |
---|
MetadataDescriptor(Class javaClass)
INTERNAL:
|
Modifier and Type | Method and Description |
---|---|
void |
addAccessor(MetadataAccessor accessor)
INTERNAL:
|
void |
addAggregateDescriptor(MetadataDescriptor aggregateDescriptor)
INTERNAL:
|
void |
addAssociationOverride(String attributeName,
MetadataJoinColumns joinColumns)
INTERNAL:
|
void |
addAttributeOverride(MetadataColumn column)
INTERNAL:
|
void |
addClassIndicator(Class entityClass,
String value)
INTERNAL:
|
void |
addDefaultEventListener(MetadataEntityListener listener)
INTERNAL:
|
void |
addEntityListenerEventListener(MetadataEntityListener listener)
INTERNAL:
|
void |
addIdAttributeName(String idAttributeName)
INTERNAL:
|
void |
addMapping(DatabaseMapping mapping)
INTERNAL:
|
void |
addMultipleTableForeignKeyField(DatabaseField pkField,
DatabaseField fkField)
INTERNAL:
|
void |
addMultipleTablePrimaryKeyField(DatabaseField pkField,
DatabaseField fkField)
INTERNAL:
|
void |
addPKClassId(String attributeName,
Type type)
INTERNAL:
We store these to validate the primary class when processing
the entity class.
|
void |
addPrimaryKeyField(DatabaseField field)
INTERNAL:
|
void |
addTable(DatabaseTable table)
INTERNAL:
|
boolean |
excludeSuperclassListeners()
INTERNAL:
|
MetadataAccessor |
getAccessorFor(String fieldOrPropertyName)
INTERNAL:
This method will first check for an accessor with name equal to
fieldOrPropertyName (that is, assumes it is a field name).
|
String |
getAlias()
INTERNAL:
|
MetadataJoinColumns |
getAssociationOverrideFor(String attributeName)
INTERNAL:
|
MetadataColumn |
getAttributeOverrideFor(String attributeName)
INTERNAL:
|
MetadataAccessor |
getBiDirectionalManyToManyAccessor(String className,
String attributeName)
INTERNAL:
Assumes hasBidirectionalManyToManyAccessorFor has been called before
hand.
|
String |
getCatalog()
INTERNAL:
|
ClassAccessor |
getClassAccessor()
INTERNAL:
|
ClassDescriptor |
getClassDescriptor()
INTERNAL:
|
DatabaseField |
getClassIndicatorField()
INTERNAL:
|
String |
getDefaultTableName()
INTERNAL:
The default table name is the descriptor alias, unless this descriptor
metadata is an inheritance subclass with a SINGLE_TABLE strategy.
|
String |
getEmbeddedIdAttributeName()
INTERNAL:
|
String |
getIdAttributeName()
INTERNAL:
Return the primary key attribute name for this entity.
|
List<String> |
getIdAttributeNames()
INTERNAL:
Return the id attribute names declared on this descriptor metadata.
|
List<String> |
getIdOrderByAttributeNames()
INTERNAL:
Return the primary key attribute names for this entity.
|
Class |
getJavaClass()
INTERNAL:
|
String |
getJavaClassName()
INTERNAL:
|
MetadataLogger |
getLogger()
INTERNAL:
|
DatabaseMapping |
getMappingForAttributeName(String attributeName)
INTERNAL:
|
DatabaseMapping |
getMappingForAttributeName(String attributeName,
MetadataAccessor referencingAccessor)
INTERNAL:
Non-owning mappings that need to look up the owning mapping, should call
this method with their respective accessor to check for circular mappedBy
references.
|
List<DatabaseMapping> |
getMappings()
INTERNAL:
|
List<String> |
getOrderByAttributeNames()
INTERNAL:
This will return the attribute names for all the direct to field mappings
on this descriptor metadata.
|
String |
getPKClassName()
INTERNAL:
|
String |
getPrimaryKeyFieldName()
INTERNAL:
Method to return the primary key field name for the given descriptor
metadata.
|
List<String> |
getPrimaryKeyFieldNames()
INTERNAL:
Method to return the primary key field names for the given descriptor
metadata.
|
List<DatabaseField> |
getPrimaryKeyFields()
INTERNAL:
Return the primary key fields for this descriptor metadata.
|
String |
getPrimaryKeyJoinColumnAssociation(String foreignKeyName)
INTERNAL:
Recursively check the potential chaining of the primart key fields from
a inheritance subclass, all the way to the root of the inheritance
hierarchy.
|
String |
getPrimaryKeyTableName()
INTERNAL:
Assumes there is one primary key field set.
|
String |
getPrimaryTableName()
INTERNAL:
|
MetadataProject |
getProject()
INTERNAL:
|
Collection<RelationshipAccessor> |
getRelationshipAccessors()
INTERNAL:
|
String |
getSchema()
INTERNAL:
|
DatabaseField |
getSequenceNumberField()
INTERNAL:
|
MetadataValidator |
getValidator()
INTERNAL:
|
boolean |
hasAssociationOverrideFor(String attributeName)
INTERNAL:
|
boolean |
hasAttributeOverrideFor(String attributeName)
INTERNAL:
|
boolean |
hasBiDirectionalManyToManyAccessorFor(String className,
String attributeName)
INTERNAL:
|
boolean |
hasCompositePrimaryKey()
INTERNAL:
|
boolean |
hasEmbeddedIdAttribute()
INTERNAL:
|
boolean |
hasInheritance()
INTERNAL:
|
boolean |
hasMappingForAttributeName(String attributeName)
INTERNAL:
|
boolean |
hasPrimaryKeyFields()
INTERNAL:
Return true is the descriptor has primary key fields set.
|
boolean |
ignoreAnnotations()
INTERNAL:
Indicates whether or not annotations should be ignored, i.e.
|
boolean |
ignoreIDs()
INTERNAL:
|
boolean |
ignoreInheritance()
INTERNAL:
|
boolean |
ignoreTables()
INTERNAL:
|
boolean |
isCascadePersist()
INTERNAL:
Indicates that cascade-persist should be applied to all relationship
mappings for this entity.
|
boolean |
isEmbeddable()
INTERNAL:
|
boolean |
isEmbeddableCollection()
INTERNAL:
|
boolean |
isXmlFieldAccess()
INTERNAL:
Indicates that we found an XML field access type for this metadata
descriptor.
|
boolean |
isXmlPropertyAccess()
INTERNAL:
Indicates that we found an XML property access type for this metadata
descriptor.
|
boolean |
pkClassWasNotValidated()
INTERNAL:
|
void |
setAccess(String access)
INTERNAL:
|
void |
setAlias(String alias)
INTERNAL:
|
void |
setCatalog(String xmlCatalog)
INTERNAL:
|
void |
setClassAccessor(ClassAccessor accessor)
INTERNAL:
|
void |
setClassIndicatorField(DatabaseField field)
INTERNAL:
|
void |
setDescriptor(ClassDescriptor descriptor)
INTERNAL:
|
void |
setEmbeddedIdAttributeName(String embeddedIdAttributeName)
INTERNAL:
|
void |
setEntityEventListener(MetadataEntityListener listener)
INTERNAL:
|
void |
setExcludeDefaultListeners(boolean excludeDefaultListeners)
INTERNAL:
|
void |
setExcludeSuperclassListeners(boolean excludeSuperclassListeners)
INTERNAL:
|
void |
setIgnoreAnnotations(boolean ignoreAnnotations)
INTERNAL:
Indicates that all annotations should be ignored, and only default values
set by the annotations processor.
|
void |
setIgnoreFlags()
INTERNAL:
|
void |
setInheritanceStrategy(String inheritanceStrategy)
INTERNAL:
Stored on the root class of an inheritance hierarchy.
|
void |
setIsCascadePersist(boolean isCascadePersist)
INTERNAL:
Indicates that cascade-persist should be added to the set of cascade
values for all relationship mappings.
|
void |
setIsEmbeddable()
INTERNAL:
|
void |
setIsIsolated(boolean isIsolated)
INTERNAL:
|
void |
setJavaClass(Class javaClass)
INTERNAL:
Used to set this descriptors java class.
|
protected void |
setOptimisticLockingPolicy(OptimisticLockingPolicy policy)
INTERNAL:
|
void |
setParentClass(Class parent)
INTERNAL:
Set the inheritance parent class for this class.
|
void |
setPKClass(Class pkClass)
INTERNAL:
|
void |
setPKClass(String pkClassName)
INTERNAL:
|
void |
setPrimaryTable(DatabaseTable primaryTable)
INTERNAL:
|
void |
setSchema(String xmlSchema)
INTERNAL:
|
void |
setSequenceNumberField(DatabaseField field)
INTERNAL:
|
void |
setSequenceNumberName(String name)
INTERNAL:
|
void |
setSingleTableInheritanceStrategy()
INTERNAL:
Sets the strategy on the descriptor's inheritance policy to SINGLE_TABLE.
|
void |
setUsesPropertyAccess(Boolean usesPropertyAccess)
INTERNAL:
Set the access-type while processing a class like Embeddable as it
inherits the access-type from the referencing entity.
|
boolean |
usesJoinedInheritanceStrategy()
INTERNAL:
Indicates if the strategy on the descriptor's inheritance policy is
JOINED.
|
boolean |
usesOptimisticLocking()
INTERNAL:
|
boolean |
usesPropertyAccess()
INTERNAL:
Returns true if this class uses property access.
|
boolean |
usesSingleTableInheritanceStrategy()
INTERNAL:
Indicates if the strategy on the descriptor's inheritance policy is
SINGLE_TABLE.
|
void |
useTimestampLockingPolicy(DatabaseField field)
INTERNAL:
|
void |
useVersionLockingPolicy(DatabaseField field)
INTERNAL:
|
protected void |
useVersionLockingPolicy(VersionLockingPolicy policy)
INTERNAL:
|
void |
validatePKClassId(String attributeName,
Type type)
INTERNAL:
This method is used only to validate id fields that were found on a
pk class were also found on the entity.
|
protected ClassAccessor m_accessor
protected ClassDescriptor m_descriptor
protected Class m_javaClass
protected boolean m_ignoreIDs
protected boolean m_ignoreTables
protected boolean m_isCascadePersist
protected boolean m_ignoreAnnotations
protected boolean m_ignoreInheritance
protected Boolean m_usesPropertyAccess
protected String m_xmlSchema
protected String m_xmlCatalog
protected String m_xmlAccess
protected String m_primaryTableName
protected String m_embeddedIdAttributeName
protected List<MetadataDescriptor> m_aggregateDescriptors
protected Map<String,MetadataAccessor> m_accessors
protected Map<String,MetadataColumn> m_attributeOverrides
protected Map<String,MetadataJoinColumns> m_associationOverrides
protected Map<String,RelationshipAccessor> m_relationshipAccessors
protected Map<String,Map<String,MetadataAccessor>> m_biDirectionalManyToManyAccessors
public MetadataDescriptor(Class javaClass)
public void addAccessor(MetadataAccessor accessor)
public void addAggregateDescriptor(MetadataDescriptor aggregateDescriptor)
public void addAssociationOverride(String attributeName, MetadataJoinColumns joinColumns)
public void addAttributeOverride(MetadataColumn column)
public void addDefaultEventListener(MetadataEntityListener listener)
public void addEntityListenerEventListener(MetadataEntityListener listener)
public void addIdAttributeName(String idAttributeName)
public void addMapping(DatabaseMapping mapping)
public void addMultipleTableForeignKeyField(DatabaseField pkField, DatabaseField fkField)
public void addMultipleTablePrimaryKeyField(DatabaseField pkField, DatabaseField fkField)
public void addPKClassId(String attributeName, Type type)
public void addPrimaryKeyField(DatabaseField field)
public void addTable(DatabaseTable table)
public boolean excludeSuperclassListeners()
public MetadataAccessor getAccessorFor(String fieldOrPropertyName)
public String getAlias()
public MetadataJoinColumns getAssociationOverrideFor(String attributeName)
public MetadataColumn getAttributeOverrideFor(String attributeName)
public DatabaseField getClassIndicatorField()
public String getDefaultTableName()
public String getCatalog()
public ClassAccessor getClassAccessor()
public ClassDescriptor getClassDescriptor()
public String getEmbeddedIdAttributeName()
public String getIdAttributeName()
public List<String> getIdAttributeNames()
public List<String> getIdOrderByAttributeNames()
public MetadataAccessor getBiDirectionalManyToManyAccessor(String className, String attributeName)
public List<String> getOrderByAttributeNames()
public Class getJavaClass()
public String getJavaClassName()
public MetadataLogger getLogger()
public DatabaseMapping getMappingForAttributeName(String attributeName)
public DatabaseMapping getMappingForAttributeName(String attributeName, MetadataAccessor referencingAccessor)
public List<DatabaseMapping> getMappings()
public String getPKClassName()
public String getPrimaryKeyFieldName()
public List<String> getPrimaryKeyFieldNames()
public List<DatabaseField> getPrimaryKeyFields()
public String getPrimaryKeyJoinColumnAssociation(String foreignKeyName)
public String getPrimaryKeyTableName()
public String getPrimaryTableName()
public MetadataProject getProject()
public Collection<RelationshipAccessor> getRelationshipAccessors()
public String getSchema()
public DatabaseField getSequenceNumberField()
public MetadataValidator getValidator()
public boolean hasAssociationOverrideFor(String attributeName)
public boolean hasAttributeOverrideFor(String attributeName)
public boolean hasCompositePrimaryKey()
public boolean hasEmbeddedIdAttribute()
public boolean hasInheritance()
public boolean hasBiDirectionalManyToManyAccessorFor(String className, String attributeName)
public boolean hasMappingForAttributeName(String attributeName)
public boolean hasPrimaryKeyFields()
public boolean ignoreIDs()
public boolean ignoreInheritance()
public boolean ignoreTables()
public boolean isCascadePersist()
public boolean isEmbeddable()
public boolean isEmbeddableCollection()
public boolean isXmlFieldAccess()
public boolean isXmlPropertyAccess()
public boolean pkClassWasNotValidated()
public void setAccess(String access)
public void setAlias(String alias)
public void setCatalog(String xmlCatalog)
public void setClassAccessor(ClassAccessor accessor)
public void setClassIndicatorField(DatabaseField field)
public void setDescriptor(ClassDescriptor descriptor)
public void setEmbeddedIdAttributeName(String embeddedIdAttributeName)
public void setEntityEventListener(MetadataEntityListener listener)
public void setExcludeDefaultListeners(boolean excludeDefaultListeners)
public void setExcludeSuperclassListeners(boolean excludeSuperclassListeners)
public void setIgnoreFlags()
public void setInheritanceStrategy(String inheritanceStrategy)
public void setIsCascadePersist(boolean isCascadePersist)
public void setIsEmbeddable()
public void setIsIsolated(boolean isIsolated)
public void setJavaClass(Class javaClass)
protected void setOptimisticLockingPolicy(OptimisticLockingPolicy policy)
public void setParentClass(Class parent)
public void setPKClass(Class pkClass)
public void setPKClass(String pkClassName)
public void setPrimaryTable(DatabaseTable primaryTable)
public void setSchema(String xmlSchema)
public void setSequenceNumberField(DatabaseField field)
public void setSequenceNumberName(String name)
public void setIgnoreAnnotations(boolean ignoreAnnotations)
public void setSingleTableInheritanceStrategy()
public boolean ignoreAnnotations()
public void setUsesPropertyAccess(Boolean usesPropertyAccess)
public boolean usesJoinedInheritanceStrategy()
public boolean usesOptimisticLocking()
public boolean usesPropertyAccess()
public boolean usesSingleTableInheritanceStrategy()
public void useTimestampLockingPolicy(DatabaseField field)
public void useVersionLockingPolicy(DatabaseField field)
protected void useVersionLockingPolicy(VersionLockingPolicy policy)
Copyright © 2024. All rights reserved.