|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.metadata.MetaData
org.datanucleus.metadata.AbstractMemberMetaData
public abstract class AbstractMemberMetaData
Abstract representation of MetaData for a field/property of a class/interface. The term "member" is used to represent either a field or a method(property). The term property is used to represent the name after cutting off any Java-beans style "get" prefix. This class is extended for fields (FieldMetaData) and properties (PropertyMetaData) to provide the explicit support for those components.
| Field Summary | |
|---|---|
protected boolean |
cacheable
cacheable tag value. |
protected boolean |
cascadeDelete
Whether to delete this relation when deleting the owning object (JPA). |
protected boolean |
cascadePersist
Whether to persist this relation when persisting the owning object. |
protected boolean |
cascadeRefresh
Whether to refresh this relation when refreshing the owning object (JPA). |
protected boolean |
cascadeUpdate
Whether to update this relation when updating the owning object. |
protected java.lang.String |
catalog
Catalog for the table specified for this field. |
protected java.lang.String |
className
Name of the class to which this field really belongs. |
protected java.lang.String |
column
column tag value. |
protected ColumnMetaData[] |
columnMetaData
Contains the metadata for column(s). |
protected java.util.List |
columns
Columns ColumnMetaData |
protected ContainerMetaData |
container
Meta-Data of any container. |
static int |
DEFAULT_RECURSION_DEPTH
Default recursion-depth according to proposed final draft spec, [12.7.2]. |
protected java.lang.Boolean |
defaultFetchGroup
default-fetch-group tag value. |
protected java.lang.Boolean |
dependent
Whether this field contains a reference that should be deleted when deleting this field. |
protected ElementMetaData |
elementMetaData
ElementMetaData. |
protected java.lang.Boolean |
embedded
embedded tag value. |
protected EmbeddedMetaData |
embeddedMetaData
EmbeddedMetaData. |
protected int |
fieldId
Id of the field in its class (only for fields managed by JDO). |
protected java.lang.String[] |
fieldTypes
Specification of the possible type(s) that can be stored in this field. |
protected ForeignKeyMetaData |
foreignKeyMetaData
ForeignKeyMetaData. |
protected java.lang.String |
fullFieldName
Cache result of getFullFieldName() |
protected IndexedValue |
indexed
The indexing value |
protected IndexMetaData |
indexMetaData
IndexMetaData. |
protected byte |
jdoFieldFlag
JDO Flags for use in enhancement process - see JDO spec 21.14. |
protected JoinMetaData |
joinMetaData
JoinMetaData. |
protected KeyMetaData |
keyMetaData
KeyMetaData. |
protected java.lang.String |
loadFetchGroup
load-fetch-group value. |
protected java.lang.String |
mappedBy
mapped-by tag value. |
protected int |
modifiers
Field modifiers |
protected java.lang.String |
name
Field name. |
protected NullValue |
nullValue
null-value tag value (default is NONE). |
protected boolean |
ordered
Temporary flag to signify if the field is ordered. |
protected OrderMetaData |
orderMetaData
OrderMetaData. |
protected FieldPersistenceModifier |
persistenceModifier
persistence-modifier tag value. |
protected java.lang.Boolean |
primaryKey
primary key tag value. |
protected int |
recursionDepth
recursion-depth value. |
protected AbstractMemberMetaData[] |
relatedMemberMetaData
MetaData for the other end of a relation when this member is a bidirectional relation. |
protected int |
relationType
The relation type of this field (1-1, 1-N, M-N, N-1). |
protected java.lang.String |
schema
Schema for the table specified for this field. |
protected java.lang.String |
sequence
If the value-strategy is sequence, the sequence attribute specifies the name of the sequence to use to automatically generate a value for the field. |
protected java.lang.Boolean |
serialized
serialized tag value. |
protected boolean |
storeInLob
Wrapper for the ugly JPA "lob" so that when being populated we should make this serialised in some way. |
protected java.lang.String |
table
Table name for this field. |
protected java.lang.String |
targetClassName
Name of the target entity (when used with JPA MetaData on OneToOne, OneToMany etc) |
protected java.lang.Class |
type
Field type being represented by this MetaData. |
static int |
UNDEFINED_RECURSION_DEPTH
Indicates the recursion-depth is not defined. |
protected boolean |
uniqueConstraint
Whether to add a unique constraint. |
protected UniqueMetaData |
uniqueMetaData
UniqueMetaData. |
protected java.lang.String |
valueGeneratorName
Name of a value generator if the user wants to override the default JPOX generator. |
protected ValueMetaData |
valueMetaData
ValueMetaData. |
protected IdentityStrategy |
valueStrategy
The value-strategy attribute specifies the strategy used to generate values for the field. |
| Fields inherited from class org.datanucleus.metadata.MetaData |
|---|
extensions, LOCALISER, METADATA_CREATED_STATE, METADATA_INITIALISED_STATE, METADATA_POPULATED_STATE, METADATA_USED_STATE, metaDataState, parent, VENDOR_NAME, VENDOR_NAME_OLD |
| Constructor Summary | |
|---|---|
AbstractMemberMetaData(MetaData parent,
AbstractMemberMetaData fmd)
Convenience constructor to copy the specification from the passed field. |
|
AbstractMemberMetaData(MetaData parent,
java.lang.String name)
Convenience constructor taking defaults |
|
AbstractMemberMetaData(MetaData parent,
java.lang.String name,
java.lang.String pk,
java.lang.String modifier,
java.lang.String defaultFetchGroup,
java.lang.String nullValue,
java.lang.String embedded,
java.lang.String serialized,
java.lang.String dependent,
java.lang.String mappedBy,
java.lang.String column,
java.lang.String table,
java.lang.String catalog,
java.lang.String schema,
java.lang.String deleteAction,
java.lang.String indexed,
java.lang.String unique,
java.lang.String recursionDepth,
java.lang.String loadFetchGroup,
java.lang.String valueStrategy,
java.lang.String sequence,
java.lang.String fieldType)
Constructor. |
|
| Method Summary | |
|---|---|
void |
addColumn(ColumnMetaData colmd)
Add a new ColumnMetaData element |
boolean |
calcIsSecondClassMutable()
Calculate wether this field should be a second class mutable field. |
int |
compareTo(java.lang.Object o)
Comparator method. |
boolean |
fieldBelongsToClass()
Accessor for whether the field is for a superclass, and not for this class. |
int |
getAbsoluteFieldNumber()
Accessor for the field id |
AbstractClassMetaData |
getAbstractClassMetaData()
Convenience accessor for the MetaData of the parent class. |
ArrayMetaData |
getArray()
Accessor for an array container for this field. |
java.lang.String |
getCatalog()
Accessor for the catalog name |
java.lang.String |
getClassName()
Accessor for the fully-qualified class name owning this field. |
java.lang.String |
getClassName(boolean fully_qualified)
Convenience to return the class name that this a field of. |
CollectionMetaData |
getCollection()
Accessor for a collection container for this field. |
java.lang.String |
getColumn()
Accessor for the column |
ColumnMetaData[] |
getColumnMetaData()
Acessor for the columns |
ContainerMetaData |
getContainer()
Accessor for the container for this field. |
FieldPersistenceModifier |
getDefaultFieldPersistenceModifier(java.lang.Class c,
int modifier,
boolean isPCclass)
Accessor for the default "persistence-modifier" for a field given the class, its modifier and whether it is a PersistentCapable class. |
ElementMetaData |
getElementMetaData()
Accessor for elementMetaData |
EmbeddedMetaData |
getEmbeddedMetaData()
Accessor for embeddedMetaData |
int |
getFieldId()
Accessor for the field id. |
java.lang.String[] |
getFieldTypes()
Accessor for the implementation type(s) that can be stored in this field when it is a reference type. |
ForeignKeyMetaData |
getForeignKeyMetaData()
Accessor for foreignKeyMetaData |
java.lang.String |
getFullFieldName()
Accessor for the full field name. |
IndexMetaData |
getIndexMetaData()
Accessor for indexMetaData |
byte |
getJdoFieldFlag()
Accessor for the JDO field flag |
JoinMetaData |
getJoinMetaData()
Accessor for joinMetaData |
KeyMetaData |
getKeyMetaData()
Accessor for keyMetaData |
java.lang.String |
getLoadFetchGroup()
Accessor for the (additional) fetch group for loading this field |
MapMetaData |
getMap()
Accessor for a map container for this field. |
java.lang.String |
getMappedBy()
Accessor for mappedBy |
MetaDataManager |
getMetaDataManager()
Convenience accessor for the MetaData Manager in use. |
java.lang.String |
getName()
Accessor for the field name |
NullValue |
getNullValue()
Accessor for the null-value tag |
OrderMetaData |
getOrderMetaData()
Accessor for orderMetaData |
protected MetaData |
getOverallParentClassMetaData(MetaData metadata)
Convenience method to navigate back through the parents to find the overall ClassMetaData handling this object. |
FieldPersistenceModifier |
getPersistenceModifier()
Accessor for the persistence-modifier tag value |
int |
getRecursionDepth()
Accessor for the depth of the fetch when recursing |
AbstractMemberMetaData[] |
getRelatedMemberMetaData(ClassLoaderResolver clr)
Accessor for the FieldMetaData of any related field/property (where this field is part of a bidirectional relation). |
AbstractMemberMetaData |
getRelatedMemberMetaDataForObject(ClassLoaderResolver clr,
java.lang.Object thisPC,
java.lang.Object otherPC)
Convenience accessor for the MetaData for the field/property at the other side of the bidirectional relation given the objects at this side and the other side. |
int |
getRelationType(ClassLoaderResolver clr)
Accessor for the relation type for this field. |
java.lang.String |
getSchema()
Accessor for the schema name |
java.lang.String |
getSequence()
If the value-strategy is sequence, the sequence attribute specifies the name of the sequence to use to automatically generate a value for the field. |
java.lang.String |
getTable()
Accessor for the table name |
java.lang.Class |
getType()
Accessor for the field type |
java.lang.String |
getTypeName()
Accessor for the field type name |
UniqueMetaData |
getUniqueMetaData()
Accessor for uniqueMetaData |
java.lang.String |
getValueGeneratorName()
Name of a (user-provided) value generator to override the default JPOX generator for this strategy. |
ValueMetaData |
getValueMetaData()
Accessor for valueMetaData |
IdentityStrategy |
getValueStrategy()
The value-strategy attribute specifies the strategy used to generate values for the field. |
boolean |
hasArray()
Accessor for whether the field has an array |
boolean |
hasCollection()
Accessor for whether the field has a collection |
boolean |
hasContainer()
Accessor for whether the field has a container. |
boolean |
hasMap()
Accessor for whether the field has a map. |
void |
initialise()
Initialisation method. |
boolean |
isAbstract()
Convenience method to return if this field represents an abstract property. |
boolean |
isCacheable()
Accessor for the cacheable tag value. |
boolean |
isCascadeDelete()
Accessor for the whether this field should be cascaded at delete |
boolean |
isCascadePersist()
Accessor for the whether this field should be cascaded at persist |
boolean |
isCascadeRefresh()
Accessor for the whether this field should be cascaded at refresh |
boolean |
isCascadeUpdate()
Accessor for the whether this field should be cascaded at update |
boolean |
isDefaultFetchGroup()
Accessor for the default-fetch-group tag value |
boolean |
isDependent()
Accessor for the dependent attribute indicates that the field contains a reference that is to be deleted from the datastore if the referring instance in which the field is declared is deleted, or if the referring field is nullified. |
boolean |
isEmbedded()
Accessor for the embedded tag value. |
boolean |
isFieldArrayTypePersistable()
Utility to return if this array field has elements that are Persistable. |
boolean |
isFieldTypePersistable()
Utility to return if this field is persistable. |
boolean |
isFinal()
Convenience method to return if this field/property is final. |
boolean |
isJdoField()
Accessor for whether the field is to be managed by JPOX. |
boolean |
isPersistentInterface(ClassLoaderResolver clr)
Convenience method to return if this member relates to a persistent interface. |
boolean |
isPrimaryKey()
Accessor for the primary-key tag value. |
boolean |
isPrivate()
Convenience method to return if this field/property is private. |
abstract boolean |
isProperty()
Whether this uses getter/setter accessors (Property) or used field based access (Field) |
boolean |
isProtected()
Convenience method to return if this field/property is protected. |
boolean |
isPublic()
Convenience method to return if this field/property is public. |
boolean |
isRelationOwner(ClassLoaderResolver clr)
Convenience method for whether this field is the owner of the relation. |
boolean |
isSerialized()
Accessor for the serialized tag value |
boolean |
isStatic()
Convenience method to return if this field/property is static. |
boolean |
isTransient()
Convenience method to return if this field/property is transient. |
void |
populate(ClassLoaderResolver clr,
java.lang.reflect.Field field,
java.lang.reflect.Method method,
java.lang.ClassLoader primary)
Method to provide the details of the field being represented by this MetaData hence populating certain parts of the MetaData. |
void |
setCacheable(boolean cache)
Convenience method to set the cacheability of this class. |
void |
setCascadeDelete(boolean cascade)
Mutator for the cascading of delete operations on this field. |
void |
setCascadePersist(boolean cascade)
Mutator for the cascading of persist operations on this field. |
void |
setCascadeRefresh(boolean cascade)
Mutator for the cascading of refresh operations on this field. |
void |
setCascadeUpdate(boolean cascade)
Mutator for the cascading of update operations on this field. |
void |
setCatalog(java.lang.String catalog)
Mutator for the catalog name |
void |
setContainer(ContainerMetaData conmd)
Method to set the container for this field (if this field represents a container (collection, map, array). |
void |
setDefaultFetchGroup(boolean dfg)
Convenience method to set the DFG if needing setting after construction. |
void |
setDependent(boolean dependent)
Mutator for dependent attribute. |
void |
setElementMetaData(ElementMetaData elementMetaData)
Mutator for the element MetaData |
void |
setEmbeddedMetaData(EmbeddedMetaData embeddedMetaData)
Mutator for the embedded MetaData |
void |
setForeignKeyMetaData(ForeignKeyMetaData foreignKeyMetaData)
Mutator for the foreignKey MetaData |
void |
setIndexMetaData(IndexMetaData indexMetaData)
Mutator for the index MetaData |
void |
setJoinMetaData(JoinMetaData joinMetaData)
Mutator for the join MetaData |
void |
setKeyMetaData(KeyMetaData keyMetaData)
Mutator for the key MetaData |
void |
setLoadFetchGroup(java.lang.String loadFetchGroup)
Convenience method to set the load fetch group if required after construction. |
void |
setMappedBy(java.lang.String mappedby)
Mutator for mappedBy |
void |
setNotPersistent()
Convenience method to mark this field as not-persistent. |
void |
setOrdered()
Mutator for whether the collection stored in this field is ordered. |
void |
setOrderMetaData(OrderMetaData orderMetaData)
Mutator for the order MetaData |
void |
setPrimaryKey()
Convenience method to make this field (part of) the primary key. |
protected void |
setRelation(ClassLoaderResolver clr)
Convenience method that sets up the relation type of this field, and the reference to any related field when it is bidirectional. |
void |
setSchema(java.lang.String schema)
Mutator for the schema name |
void |
setSequence(java.lang.String sequence)
If the value-strategy is sequence, the sequence attribute specifies the name of the sequence to use to automatically generate a value for the field. |
void |
setSerialised()
Convenience method to mark this field to be stored serialised. |
void |
setStoreInLob()
Mutator for whetehr to store as a "lob". |
void |
setTable(java.lang.String table)
Mutator for the table name |
void |
setTargetClassName(java.lang.String target)
Mutator for the target class name. |
void |
setTransactional()
Convenience method to mark this field as transactional. |
void |
setUniqueMetaData(UniqueMetaData uniqueMetaData)
Mutator for the unique MetaData |
void |
setValueGeneratorName(java.lang.String generator)
Mutator for the name of the value generator to use for this strategy. |
void |
setValueMetaData(ValueMetaData valueMetaData)
Mutator for the value MetaData |
void |
setValueStrategy(IdentityStrategy valueStrategy)
The value-strategy attribute specifies the strategy used to generate values for the field. |
java.lang.String |
toString(java.lang.String prefix,
java.lang.String indent)
Returns a string representation of the object using a prefix This can be used as part of a facility to output a MetaData file. |
| Methods inherited from class org.datanucleus.metadata.MetaData |
|---|
addExtension, addExtension, getExtensions, getNoOfExtensions, getParent, getValueForExtension, getValuesForExtension, hasExtension, isInitialised, isPopulated, isUsed, removeExtension, setInitialised, setParent, setPopulated, setUsed, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected ColumnMetaData[] columnMetaData
protected ContainerMetaData container
protected EmbeddedMetaData embeddedMetaData
protected JoinMetaData joinMetaData
protected ElementMetaData elementMetaData
protected KeyMetaData keyMetaData
protected ValueMetaData valueMetaData
protected IndexMetaData indexMetaData
protected IndexedValue indexed
protected UniqueMetaData uniqueMetaData
protected final boolean uniqueConstraint
protected OrderMetaData orderMetaData
protected ForeignKeyMetaData foreignKeyMetaData
protected java.lang.Boolean defaultFetchGroup
protected java.lang.String column
protected java.lang.String mappedBy
protected java.lang.Boolean embedded
protected java.lang.Boolean dependent
protected java.lang.Boolean serialized
protected boolean cacheable
protected boolean cascadePersist
protected boolean cascadeUpdate
protected boolean cascadeDelete
protected boolean cascadeRefresh
protected java.lang.String loadFetchGroup
public static final int DEFAULT_RECURSION_DEPTH
public static final int UNDEFINED_RECURSION_DEPTH
protected int recursionDepth
protected final java.lang.String name
protected NullValue nullValue
protected FieldPersistenceModifier persistenceModifier
protected java.lang.Boolean primaryKey
protected java.lang.String table
protected java.lang.String catalog
protected java.lang.String schema
protected IdentityStrategy valueStrategy
protected java.lang.String valueGeneratorName
protected java.lang.String sequence
protected java.lang.String className
protected java.lang.String fullFieldName
getFullFieldName()
protected java.lang.String[] fieldTypes
protected java.lang.Class type
protected int modifiers
protected int fieldId
protected int relationType
protected AbstractMemberMetaData[] relatedMemberMetaData
protected boolean ordered
protected java.util.List columns
protected java.lang.String targetClassName
protected boolean storeInLob
protected byte jdoFieldFlag
| Constructor Detail |
|---|
public AbstractMemberMetaData(MetaData parent,
java.lang.String name)
parent - Parent componentname - Name of the field
public AbstractMemberMetaData(MetaData parent,
AbstractMemberMetaData fmd)
parent - The parentfmd - The field to copy
public AbstractMemberMetaData(MetaData parent,
java.lang.String name,
java.lang.String pk,
java.lang.String modifier,
java.lang.String defaultFetchGroup,
java.lang.String nullValue,
java.lang.String embedded,
java.lang.String serialized,
java.lang.String dependent,
java.lang.String mappedBy,
java.lang.String column,
java.lang.String table,
java.lang.String catalog,
java.lang.String schema,
java.lang.String deleteAction,
java.lang.String indexed,
java.lang.String unique,
java.lang.String recursionDepth,
java.lang.String loadFetchGroup,
java.lang.String valueStrategy,
java.lang.String sequence,
java.lang.String fieldType)
parent - parent MetaData instancename - field namepk - attribute primary-key valuemodifier - attribute persistence-modifier valuedefaultFetchGroup - attribute default-fetch-group valuenullValue - attribute null-value valueembedded - attribute embedded valueserialized - attribute serialized valuedependent - attribute dependent valuemappedBy - attribute mapped-by valuecolumn - attribute column valuetable - attribute table valuecatalog - attribute catalog valueschema - attribute schema valuedeleteAction - attribute delete-action valueindexed - Whether this is indexedunique - Apply a unique constraintrecursionDepth - The depth of fetch to use when recursingloadFetchGroup - Name of the additional fetch group to use when loadingvalueStrategy - attribute value-strategy valuesequence - attribute sequence valuefieldType - Implementation type(s) for field.| Method Detail |
|---|
public void populate(ClassLoaderResolver clr,
java.lang.reflect.Field field,
java.lang.reflect.Method method,
java.lang.ClassLoader primary)
clr - ClassLoaderResolver to use for any class loadingfield - Field that we are representing (if it's a field)method - Method(property) that we are representing (if it's a method).primary - the primary ClassLoader to use (or null)
public final FieldPersistenceModifier getDefaultFieldPersistenceModifier(java.lang.Class c,
int modifier,
boolean isPCclass)
c - The classmodifier - The modifiers for the fieldisPCclass - Whether it is persistence capable.
public void initialise()
initialise in class MetaDatapublic boolean isFieldTypePersistable()
public boolean isFieldArrayTypePersistable()
public boolean isStatic()
public boolean isFinal()
public boolean isTransient()
public boolean isPublic()
public boolean isProtected()
public boolean isPrivate()
public boolean isAbstract()
public IdentityStrategy getValueStrategy()
public java.lang.String getValueGeneratorName()
public java.lang.String getSequence()
public boolean isCacheable()
public void setCacheable(boolean cache)
public java.lang.String getLoadFetchGroup()
public void setLoadFetchGroup(java.lang.String loadFetchGroup)
loadFetchGroup - Name of the load fetch grouppublic int getRecursionDepth()
protected MetaData getOverallParentClassMetaData(MetaData metadata)
metadata - The metadata to check
public AbstractClassMetaData getAbstractClassMetaData()
public final OrderMetaData getOrderMetaData()
public java.lang.String getName()
public java.lang.String getFullFieldName()
public boolean fieldBelongsToClass()
public java.lang.String getClassName()
public java.lang.String getClassName(boolean fully_qualified)
fully_qualified - Whether the name should be fully qualified.
public NullValue getNullValue()
public FieldPersistenceModifier getPersistenceModifier()
public void setNotPersistent()
public void setTransactional()
public boolean isDefaultFetchGroup()
public void setDefaultFetchGroup(boolean dfg)
dfg - DFG string valuepublic boolean isDependent()
public boolean isEmbedded()
public boolean isSerialized()
public void setSerialised()
public boolean isCascadePersist()
public boolean isCascadeUpdate()
public boolean isCascadeDelete()
public boolean isCascadeRefresh()
public boolean isPrimaryKey()
public void setPrimaryKey()
public abstract boolean isProperty()
public java.lang.String getTable()
public java.lang.String getCatalog()
public java.lang.String getSchema()
public int getFieldId()
public final java.lang.String[] getFieldTypes()
public int getAbsoluteFieldNumber()
public java.lang.Class getType()
public java.lang.String getTypeName()
public ContainerMetaData getContainer()
public ArrayMetaData getArray()
public CollectionMetaData getCollection()
public MapMetaData getMap()
public final java.lang.String getColumn()
public final java.lang.String getMappedBy()
public final ColumnMetaData[] getColumnMetaData()
getColumnMetaData in interface ColumnMetaDataContainer