|
Kodo 4.0.0RC2 generated on May 12 2006 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectExtensions
kodo.meta.ClassMetaData
public class ClassMetaData
Contains metadata about a persistent type. This metadata is available both at enhancement time and runtime.
Note that this class employs aggressive caching, and therefore it is
important to finalize the configuration of field metadatas before invoking
methods that depend on that configuration, such as
getPrimaryKeyFields().
| Field Summary | |
|---|---|
static int |
ACCESS_FIELD
Persistent attributes are accessed via direct field access. |
static int |
ACCESS_PROPERTY
Persistent attributes are accessed via setters and getters. |
static int |
ACCESS_UNKNOWN
Unknown access type. |
protected static String |
DEFAULT_STRING
|
static int |
ID_APPLICATION
Application identity type. |
static int |
ID_DATASTORE
Datastore identity type. |
static int |
ID_UNKNOWN
Unkonwn identity type. |
static String |
SYNTHETIC
Value for using a synthetic detached state field, which is the default. |
| Constructor Summary | |
|---|---|
protected |
ClassMetaData(Class type,
MetaDataRepository repos)
Constructor. |
protected |
ClassMetaData(ValueMetaData owner)
Embedded constructor. |
| Method Summary | |
|---|---|
FieldMetaData |
addDeclaredField(String name,
Class type)
Add a new field metadata to this class. |
void |
addDeclaredLockGroup(LockGroup lg)
Declare a lock group possibly used by subclass fields. |
FieldMetaData |
addDefinedSuperclassField(String name,
Class type,
Class sup)
Add a new defined superclass field metadata to this class. |
protected void |
addExtensionKeys(Collection exts)
|
protected void |
clearAllFieldCache()
Clear cached field data. |
protected void |
clearDefinedFieldCache()
Clear defined field data. |
protected void |
clearFieldCache()
Clear cached field data. |
protected void |
clearSubclassCache()
Clear cached subclass data. |
int |
compareTo(Object other)
|
void |
copy(ClassMetaData meta)
Copy the metadata from the given instance to this one. |
void |
defineSuperclassFields(boolean force)
Incorporate superclass fields redefined in this subclass into this metadata. |
boolean |
equals(Object other)
|
int |
getAccessType()
The access type used by this class. |
String[] |
getComments()
|
DataCache |
getDataCache()
Return the data cache for this class, or null if it is not cachable. |
String |
getDataCacheName()
The name of the datacache to use for this class, or null if none. |
int |
getDataCacheTimeout()
The cache timeout for this class. |
FieldMetaData |
getDeclaredField(int index)
Return the metadata for the persistent or transactional field with the given relative index. |
FieldMetaData |
getDeclaredField(String name)
Return the metadata for the persistent or transactional field with the given name, without including superclass fields. |
FieldMetaData[] |
getDeclaredFields()
Return only the fields for this class, without superclass fields. |
FieldMetaData[] |
getDeclaredUnmanagedFields()
Return any fields that were added as non-managed. |
FieldMetaData[] |
getDefaultFetchGroupFields()
Return the list of fields in the default fetch group, including superclass fields, or an empty array if none. |
FieldMetaData[] |
getDefinedFields()
Returns an array of all the fields defined by this class. |
FieldMetaData[] |
getDefinedFieldsInListingOrder()
Returns all fields defined by this class in the order they are listed in the metadata file. |
FieldMetaData |
getDefinedSuperclassField(String name)
Return the defined superclass field with the given name, or null if none. |
Class |
getDescribedType()
The persistence capable class described by this metadata. |
String |
getDetachedState()
The name of the detach state field, or null if none. |
Field |
getDetachedStateField()
Return the detach state field, or null if none. |
ValueMetaData |
getEmbeddingMetaData()
If this metadata is for an embedded object, returning the owning value. |
ClassLoader |
getEnvClassLoader()
The environmental loader used when loading this metadata. |
int |
getExtraFieldDataIndex(int field)
Return the impl / intermediate field data index of the given field in the compacted array, or -1 if the field does not use extra data. |
int |
getExtraFieldDataLength()
Return the number of fields that use impl or intermediate data, in order to create a compacted array for storage of said data. |
FieldMetaData |
getField(int index)
Return the metadata for the persistent or transactional field with the given absolute index. |
FieldMetaData |
getField(String name)
Return the metadata for the persistent or transactional field with the given name. |
FieldMetaData[] |
getFields()
Return all field metadatas, including superclass fields. |
FieldMetaData[] |
getFieldsInListingOrder()
Returns all fields in the order they are listed in the metadata file. |
SequenceMetaData |
getIdentitySequenceMetaData()
Metadata for the datastore identity sequence. |
String |
getIdentitySequenceName()
The datastore identity sequence name, or null for none. |
int |
getIdentityStrategy()
The strategy to use for datastore identity generation. |
int |
getIdentityType()
The type of identity being used. |
LifecycleMetaData |
getLifecycleMetaData()
Information about lifecycle callbacks for this class. |
int |
getListingIndex()
The index in which this class was listed in the metadata. |
LockGroup[] |
getLockGroups()
Return the lock groups for this class. |
ClassMetaData[] |
getMappedPCSubclassMetaDatas()
Return all mapped subclasses. |
ClassMetaData |
getMappedPCSuperclassMetaData()
Return the closest mapped superclass. |
Class |
getObjectIdType()
The metadata-specified class to use for the object ID. |
Class[] |
getPCSubclasses()
Return the known persistence capable subclasses of the described type, or empty array if none or if this is embedded metadata. |
ClassMetaData[] |
getPCSubclassMetaDatas()
Return the metadata for the known persistence capable subclasses of the described type, or empty array if none or if this is embedded metadata. |
Class |
getPCSuperclass()
The persistence capable superclass of the described type. |
ClassMetaData |
getPCSuperclassMetaData()
The metadata for this class' superclass. |
FieldMetaData[] |
getPrimaryKeyFields()
Return primary key fields, or empty array if none. |
MetaDataRepository |
getRepository()
Return the owning repository. |
boolean |
getRequiresExtent()
Whether the type requires extent management. |
int |
getResolve()
The resolve mode for this metadata. |
String |
getResourceName()
|
File |
getSourceFile()
|
int |
getSourceMode()
The source mode this metadata has been loaded under. |
Object |
getSourceScope()
|
int |
getSourceType()
|
protected FieldMetaData |
getSuperclassField(FieldMetaData supField)
Return the superclass copy of the given field. |
String |
getTypeAlias()
Returns the alias for the described type, or null if none
has been set. |
FieldMetaData |
getVersionField()
Return the version field for this class, if any. |
int |
hashCode()
|
protected void |
initializeMapping()
Initialize mapping. |
boolean |
isAccessibleField(String field)
Return whether the given name represents a managed or static field of this class, including superclass fields. |
boolean |
isAuditable()
Whether this class is auditable. |
boolean |
isDetachable()
Whether instances are detachable. |
boolean |
isEmbeddedOnly()
Whether the type can only be used as an embedded object. |
boolean |
isKodoIdentity()
Whether this type uses Kodo identity. |
boolean |
isMapped()
Whether this class is mapped to the datastore. |
boolean |
isObjectIdTypeShared()
Whether this type uses an application identity class that is shared with other classes, and is therefore wrapped in an ObjectId. |
boolean |
removeDeclaredField(FieldMetaData field)
Remove the given field from management. |
boolean |
removeDeclaredLockGroup(LockGroup lg)
Remove the given lock group from this class. |
boolean |
removeDefinedSuperclassField(FieldMetaData field)
Remove the given field from management. |
boolean |
resolve(int mode)
Resolve and validate metadata. |
protected void |
resolveMapping(boolean runtime)
Resolve mapping data. |
protected void |
resolveMeta(boolean runtime)
Resolve metadata. |
void |
setAccessType(int type)
The access type used by this class. |
void |
setAuditable(boolean auditable)
Whether this class is auditable. |
void |
setComments(String[] comments)
|
void |
setDataCacheName(String name)
Set the cache name for this class. |
void |
setDataCacheTimeout(int timeout)
The cache timeout for this class. |
protected void |
setDescribedType(Class type)
Set the class descibed by this metadata. |
void |
setDetachable(boolean detachable)
Whether instances are detachable. |
void |
setDetachedState(String field)
The name of the detach state field, or null if none. |
void |
setEmbeddedOnly(boolean embed)
Whether the type can only be used as an embedded object. |
void |
setEnvClassLoader(ClassLoader loader)
The class environmental loader used when loading this metadata. |
void |
setIdentitySequenceName(String seqName)
The datastore identity sequence name, or null for none. |
void |
setIdentityStrategy(int strategy)
The strategy to use for datastore identity generation. |
void |
setIdentityType(int type)
The type of identity being used. |
void |
setListingIndex(int index)
The index in which this field was listed in the metadata. |
void |
setObjectIdType(Class cls,
boolean shared)
The metadata-specified class to use for the object ID. |
void |
setPCSuperclass(Class pc)
The persistence capable superclass of the described type. |
void |
setPCSuperclassMetaData(ClassMetaData meta)
The metadata for this class' superclass. |
void |
setRequiresExtent(boolean req)
Whether the type requires extent management. |
void |
setResolve(int mode)
The resolve mode for this metadata. |
void |
setResolve(int mode,
boolean on)
The resolve mode for this metadata. |
void |
setSource(File file,
int srcType)
|
void |
setSourceMode(int mode)
The source mode this metadata has been loaded under. |
void |
setSourceMode(int mode,
boolean on)
The source mode this metadata has been loaded under. |
void |
setTypeAlias(String alias)
Sets the alias for the described type. |
String |
toString()
|
Boolean |
usesDetachedState()
Whether an instance of this type has detached state. |
protected void |
validateMapping(boolean runtime)
Validate mapping data. |
protected void |
validateMeta(boolean runtime)
Validate resolved metadata. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int ID_UNKNOWN
public static final int ID_DATASTORE
public static final int ID_APPLICATION
public static final int ACCESS_UNKNOWN
public static final int ACCESS_FIELD
public static final int ACCESS_PROPERTY
public static final String SYNTHETIC
protected static final String DEFAULT_STRING
| Constructor Detail |
|---|
protected ClassMetaData(Class type,
MetaDataRepository repos)
protected ClassMetaData(ValueMetaData owner)
| Method Detail |
|---|
public MetaDataRepository getRepository()
public ValueMetaData getEmbeddingMetaData()
public Class getDescribedType()
protected void setDescribedType(Class type)
public ClassLoader getEnvClassLoader()
public void setEnvClassLoader(ClassLoader loader)
public Class getPCSuperclass()
public void setPCSuperclass(Class pc)
public ClassMetaData getPCSuperclassMetaData()
public void setPCSuperclassMetaData(ClassMetaData meta)
public boolean isMapped()
public ClassMetaData getMappedPCSuperclassMetaData()
public Class[] getPCSubclasses()
public ClassMetaData[] getPCSubclassMetaDatas()
public ClassMetaData[] getMappedPCSubclassMetaDatas()
public int getIdentityType()
ID_UNKNOWN: unknown identity typeID_DATASTORE: identity managed by the data store and
independent of the fields of the instanceID_APPLICATION: identity managed by the application and
defined by one or more fields of the instanceID_DATASTORE if there are no
primary key fields, and ID_APPLICATION otherwise.
public void setIdentityType(int type)
ID_UNKNOWN: unknown identity typeID_DATASTORE: identity managed by the data store and
independent of the fields of the instanceID_APPLICATION: identity managed by the application and
defined by one or more fields of the instanceID_DATASTORE if there are no
primary key fields, and ID_APPLICATION otherwise.
public Class getObjectIdType()
public void setObjectIdType(Class cls,
boolean shared)
public boolean isObjectIdTypeShared()
ObjectId.
public boolean isKodoIdentity()
public int getIdentityStrategy()
ValueStrategies.
public void setIdentityStrategy(int strategy)
ValueStrategies.
public String getIdentitySequenceName()
public void setIdentitySequenceName(String seqName)
public SequenceMetaData getIdentitySequenceMetaData()
public LifecycleMetaData getLifecycleMetaData()
public String getTypeAlias()
null if none
has been set.
#see setTypeAlias
public void setTypeAlias(String alias)
alias - the alias name to apply to the described typepublic int getAccessType()
ACCESS_FIELD
or ACCESS_PROPERTY.
public void setAccessType(int type)
ACCESS_FIELD or ACCESS_PROPERTY.
public boolean getRequiresExtent()
public void setRequiresExtent(boolean req)
public boolean isEmbeddedOnly()
public void setEmbeddedOnly(boolean embed)
public LockGroup[] getLockGroups()
public void addDeclaredLockGroup(LockGroup lg)
public boolean removeDeclaredLockGroup(LockGroup lg)
public int getExtraFieldDataLength()
public int getExtraFieldDataIndex(int field)
getExtraFieldDataLength()public boolean isAccessibleField(String field)
public FieldMetaData[] getFields()
protected FieldMetaData getSuperclassField(FieldMetaData supField)
public FieldMetaData[] getDeclaredFields()
public FieldMetaData[] getPrimaryKeyFields()
public FieldMetaData[] getDefaultFetchGroupFields()
public FieldMetaData getVersionField()
public FieldMetaData getField(int index)
public FieldMetaData getDeclaredField(int index)
public FieldMetaData getField(String name)
public FieldMetaData getDeclaredField(String name)
public FieldMetaData[] getDeclaredUnmanagedFields()
public FieldMetaData addDeclaredField(String name,
Class type)
public boolean removeDeclaredField(FieldMetaData field)
public FieldMetaData getDefinedSuperclassField(String name)
public FieldMetaData addDefinedSuperclassField(String name,
Class type,
Class sup)
public boolean removeDefinedSuperclassField(FieldMetaData field)
public void defineSuperclassFields(boolean force)
force - whether to force re-mapping of even mapped superclass
fieldspublic FieldMetaData[] getDefinedFields()
public FieldMetaData[] getFieldsInListingOrder()
public FieldMetaData[] getDefinedFieldsInListingOrder()
public String getDataCacheName()
public void setDataCacheName(String name)
public int getDataCacheTimeout()
public void setDataCacheTimeout(int timeout)
public DataCache getDataCache()
public boolean isDetachable()
public void setDetachable(boolean detachable)
public String getDetachedState()
public void setDetachedState(String field)
public Field getDetachedStateField()
public Boolean usesDetachedState()
public boolean isAuditable()
public void setAuditable(boolean auditable)
protected void clearAllFieldCache()
protected void clearDefinedFieldCache()
protected void clearFieldCache()
protected void clearSubclassCache()
public int hashCode()
public boolean equals(Object other)
public int compareTo(Object other)
compareTo in interface Comparablepublic String toString()
public int getResolve()
public void setResolve(int mode)
public void setResolve(int mode,
boolean on)
public boolean resolve(int mode)
protected void resolveMeta(boolean runtime)
protected void validateMeta(boolean runtime)
protected void resolveMapping(boolean runtime)
protected void validateMapping(boolean runtime)
protected void initializeMapping()
public File getSourceFile()
public Object getSourceScope()
public int getSourceType()
public void setSource(File file,
int srcType)
public String getResourceName()
public int getSourceMode()
public void setSourceMode(int mode)
public void setSourceMode(int mode,
boolean on)
public int getListingIndex()
-1 if this class was not listed in the metadata.
public void setListingIndex(int index)
-1 if this class was not listed in the metadata.
public String[] getComments()
public void setComments(String[] comments)
public void copy(ClassMetaData meta)
protected void addExtensionKeys(Collection exts)
|
Kodo 4.0.0RC2 generated on May 12 2006 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||