Package org.apache.openjpa.meta
Class ClassMetaData
- java.lang.Object
 - 
- org.apache.openjpa.meta.Extensions
 - 
- org.apache.openjpa.meta.ClassMetaData
 
 
 
- 
- All Implemented Interfaces:
 Serializable,Comparable<ClassMetaData>,ValueListener,SourceTracker,Commentable,MetaDataContext,MetaDataModes
- Direct Known Subclasses:
 ClassMapping
public class ClassMetaData extends Extensions implements Comparable<ClassMetaData>, SourceTracker, MetaDataContext, MetaDataModes, Commentable, ValueListener
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 asgetPrimaryKeyFields().- Author:
 - Abe White
 - See Also:
 - Serialized Form
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description static intACCESS_EXPLICITPersistent class has explicitly defined an access type.static intACCESS_FIELDPersistent attributes are accessed via direct field access.static intACCESS_PROPERTYPersistent attributes are accessed via setters and getters.static intACCESS_UNKNOWNUnknown access type.protected static StringDEFAULT_STRINGstatic intID_APPLICATIONApplication identity type.static intID_DATASTOREDatastore identity type.static intID_UNKNOWNUnknown identity type.static StringSYNTHETICValue for using a synthetic detached state field, which is the default.- 
Fields inherited from class org.apache.openjpa.meta.Extensions
OPENJPA 
- 
Fields inherited from interface org.apache.openjpa.lib.xml.Commentable
EMPTY_COMMENTS 
- 
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 
- 
Fields inherited from interface org.apache.openjpa.lib.meta.SourceTracker
SRC_ANNOTATIONS, SRC_OTHER, SRC_XML 
 - 
 
- 
Constructor Summary
Constructors Modifier Constructor Description protectedClassMetaData(Class<?> type, MetaDataRepository repos)Constructor.protectedClassMetaData(ValueMetaData owner)Embedded constructor. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FetchGroupaddDeclaredFetchGroup(String name)Adds fetch group of the given name, or returns existing instance.FieldMetaDataaddDeclaredField(String name, Class<?> type)Add a new field metadata to this class.voidaddDeclaredInterface(Class<?> iface)Explicitly declare the given interface among the ones this class implements.FieldMetaDataaddDefinedSuperclassField(String name, Class<?> type, Class<?> sup)Add a new defined superclass field metadata to this class.protected voidaddExtensionKeys(Collection exts)Add all the known extension keys to the specified collection; any implementation that utilized new extensions should override this method to include both the known extensions of its superclass as well as its own extension keys.protected voidclearAllFieldCache()Clear cached field data.protected voidclearDefinedFieldCache()Clear defined field data.protected voidclearFieldCache()Clear cached field data.protected voidclearSubclassCache()Clear cached subclass data.intcompareTo(ClassMetaData other)voidcopy(ClassMetaData meta)Copy the metadata from the given instance to this one.voiddefineSuperclassFields(boolean force)Incorporate superclass fields redefined in this subclass into this metadata.booleanequals(Object other)intgetAccessType()The access type used by this class.BooleangetCacheEnabled()Returns tri-state status on whether this class has been enabled for caching.intgetColNumber()Return the column number in the line of the file at which this instance was parsed.String[]getComments()Return comments, or empty array if none.FetchGroup[]getCustomFetchGroups()Return all fetch groups for this type, including superclass groups but excluding the standard groups such as "default" or "all".DataCachegetDataCache()Return the data cache for this class, or null if it is not cachable.booleangetDataCacheEnabled()Affirms true if this receiver is annotated with @DataCache and is not disabled.StringgetDataCacheName()The name of the data cache that stores the managed instance of this class, by default.intgetDataCacheTimeout()The cache timeout for this class. -1 indicates no timeout.FetchGroup[]getDeclaredFetchGroups()Return the fetch groups declared explicitly in this type.FieldMetaDatagetDeclaredField(int index)Return the metadata for the persistent or transactional field with the given relative index.FieldMetaDatagetDeclaredField(String name)Return the metadata for the persistent or transactional field with the given name, without including superclass fields.String[]getDeclaredFieldNames()Utility method to get names of all declared fields excluding the superclasses' sorted in lexical order.FieldMetaData[]getDeclaredFields()Return only the fields for this class, without superclass fields.Class<?>[]getDeclaredInterfaces()Return all explicitly declared interfaces this class implements.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.FieldMetaDatagetDefinedSuperclassField(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.StringgetDescribedTypeString()The persistence capable stringified class described by this metadata.StringgetDetachedState()The name of the detach state field, or null if none.FieldgetDetachedStateField()Return the detach state field, or null if none.ValueMetaDatagetEmbeddingMetaData()If this metadata is for an embedded object, returning the owning value.ClassLoadergetEnvClassLoader()The environmental loader used when loading this metadata.intgetExtraFieldDataIndex(int field)Return the intermediate field data index of the given field in the compacted array, or -1 if the field does not use extra data.intgetExtraFieldDataLength()Return the number of fields that use impl or intermediate data, in order to create a compacted array for storage of said data.FetchGroupgetFetchGroup(String name)Gets a named fetch group.FieldMetaDatagetField(int index)Return the metadata for the persistent or transactional field with the given absolute index.FieldMetaDatagetField(String name)Return the metadata for the persistent or transactional field with the given name.String[]getFieldNames()Utility method to get names of all fields including the superclasses' sorted in lexical order.FieldMetaData[]getFields()Return all field metadata, including superclass fields.FieldMetaData[]getFieldsInListingOrder()Returns all fields in the order they are listed in the metadata file.Class<?>getIdClass()The class specified with the @IdClass annotation if usedSequenceMetaDatagetIdentitySequenceMetaData()Metadata for the datastore identity sequence.StringgetIdentitySequenceName()The datastore identity sequence name, or null for none.intgetIdentityStrategy()The strategy to use for datastore identity generation.intgetIdentityType()The type of identity being used.String[]getInterfaceAliasedProperties(Class<?> iface)Return all aliases property named for the given interface.Class<?>getInterfaceImpl()Return the managed interface implementor if any.StringgetInterfacePropertyAlias(Class<?> iface, String orig)Get local field alias for the given interface property.LifecycleMetaDatagetLifecycleMetaData()Information about lifecycle callbacks for this class.intgetLineNumber()Return the line number of the file at which this instance was parsed.intgetListingIndex()The index in which this class was listed in the metadata.FieldMetaData[]getLrsFields()Return all large result set fields.ClassMetaData[]getMappedPCSubclassMetaDatas()Return all mapped subclasses.ClassMetaDatagetMappedPCSuperclassMetaData()Return the closest mapped superclass.List<FieldMetaData>getMappyedByIdFields()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.ClassMetaDatagetPCSuperclassMetaData()The metadata for this class' superclass.int[]getPkAndNonPersistentManagedFmdIndexes()FieldMetaData[]getPrimaryKeyFields()Return primary key fields, or empty array if none.FieldMetaData[]getProxyFields()Return all fields that are types that need to be wrappered by a proxy.MetaDataRepositorygetRepository()Return the owning repository.booleangetRequiresExtent()Whether the type requires extent management.intgetResolve()The resolve mode for this metadata.StringgetResourceName()Return the domain-meaningful name of the resource that was loaded from this source.FilegetSourceFile()Return the file from which this instance was parsed.intgetSourceMode()The source mode this metadata has been loaded under.StringgetSourceName()ObjectgetSourceScope()Return the domain-dependent scope of this instance within its file.intgetSourceType()Return the type of source.protected FieldMetaDatagetSuperclassField(FieldMetaData supField)Return the superclass copy of the given field.StringgetTypeAlias()Returns the alias for the described type, ornullif none has been set.booleangetUseSchemaElement()Set whether to include schema name in generated class filesFieldMetaDatagetVersionField()Return the version field for this class, if any.booleanhasAbstractPKField()Convenience method to determine if the pcType modeled by this ClassMetaData object is both abstract and declares PKFields.inthashCode()booleanhasInverseManagedFields()booleanhasPKFieldsFromAbstractClass()Convenience method to determine if this type is a direct decendent of an abstract type declaring PKFields.protected voidinitializeMapping()Initialize mapping.booleanisAbstract()booleanisAccessibleField(String field)Return whether the given name represents a managed or static field of this class, including superclass fields.booleanisDetachable()Whether instances are detachable.booleanisEmbeddable()booleanisEmbeddedOnly()Whether the type can only be used as an embedded object.booleanisExplicitAccess()Affirms if access style is explicitly defined.booleanisIntercepting()Whether the type's fields are actively intercepted, either by redefinition or enhancement.booleanisManagedInterface()Whether the type is a managed interface.booleanisMapped()Whether this class is mapped to the datastore.booleanisMixedAccess()Affirms if attributes of this class use mixed access types.booleanisObjectIdTypeShared()Whether this type uses an application identity class that is shared with other classes, and is therefore wrapped in anObjectId.booleanisOpenJPAIdentity()Whether this type uses OpenJPA identity.voidregisterForValueUpdate(String... values)booleanremoveDeclaredFetchGroup(FetchGroup fg)Remove a declared fetch group.booleanremoveDeclaredField(FieldMetaData field)Remove the given field from management.booleanremoveDeclaredInterface(Class<?> iface)Remove the given interface from the declared list.booleanremoveDefinedSuperclassField(FieldMetaData field)Remove the given field from management.booleanresolve(int mode)Resolve and validate metadata.protected voidresolveMapping(boolean runtime)Resolve mapping data.protected voidresolveMeta(boolean runtime)Resolve metadata.voidsetAbstract(boolean flag)voidsetAccessType(int type)Sets the access type.voidsetCacheEnabled(boolean enabled)Sets the eligibility status of this class for cache.voidsetColNumber(int colNum)voidsetComments(String[] comments)Set comments.voidsetDataCacheName(String name)Set the cache name for this class.voidsetDataCacheTimeout(int timeout)The cache timeout for this class. -1 indicates no timeout.protected voidsetDescribedType(Class<?> type)Set the class described by this metadata.voidsetDetachable(boolean detachable)Whether instances are detachable.voidsetDetachedState(String field)The name of the detach state field, or null if none.voidsetEmbeddable()voidsetEmbeddedOnly(boolean embed)Whether the type can only be used as an embedded object.voidsetEnvClassLoader(ClassLoader loader)The class environmental loader used when loading this metadata.voidsetIdentitySequenceName(String seqName)The datastore identity sequence name, or null for none.voidsetIdentityStrategy(int strategy)The strategy to use for datastore identity generation.voidsetIdentityType(int type)The type of identity being used.voidsetIntercepting(boolean intercepting)Whether the type's fields are actively intercepted, either by redefinition or enhancement.voidsetInterfaceImpl(Class<?> impl)Set the managed interface implementor class.voidsetInterfacePropertyAlias(Class<?> iface, String orig, String local)Alias properties from the given interface during queries to the local field.voidsetLineNumber(int lineNum)voidsetListingIndex(int index)The index in which this field was listed in the metadata.voidsetManagedInterface(boolean managedInterface)Whether the type is a managed interfacevoidsetObjectIdType(Class<?> cls, boolean shared)The metadata-specified class to use for the object ID.voidsetPCSuperclass(Class<?> pc)The persistence capable superclass of the described type.voidsetPCSuperclassMetaData(ClassMetaData meta)The metadata for this class' superclass.voidsetRequiresExtent(boolean req)Whether the type requires extent management.voidsetResolve(int mode)The resolve mode for this metadata.voidsetResolve(int mode, boolean on)The resolve mode for this metadata.voidsetSource(File file, int srcType, String srcName)voidsetSourceMode(int mode)The source mode this metadata has been loaded under.voidsetSourceMode(int mode, boolean on)The source mode this metadata has been loaded under.voidsetTypeAlias(String alias)Sets the alias for the described type.voidsetUseSchemaElement(boolean useSchemaElement)Get whether to include schema name in generated class filesStringtoString()booleanuseIdClassFromParent()Return true if this class uses IdClass derived from idClass of the parent entity which annotated as id in the child class.BooleanusesDetachedState()Whether an instance of this type has detached state.protected voidvalidateMapping(boolean runtime)Validate mapping data.protected voidvalidateMeta(boolean runtime)Validate resolved metadata.voidvalueChanged(Value val)Callback used byValueobjects to notify listener of change.- 
Methods inherited from class org.apache.openjpa.meta.Extensions
addExtension, addExtension, copy, getBooleanExtension, getBooleanExtension, getDoubleExtension, getDoubleExtension, getEmbeddedExtensions, getEmbeddedExtensions, getExtensionKeys, getExtensionKeys, getExtensionVendors, getIntExtension, getIntExtension, getObjectExtension, getObjectExtension, getStringExtension, getStringExtension, hasExtension, hasExtension, isEmpty, removeEmbeddedExtensions, removeEmbeddedExtensions, removeExtension, removeExtension, validateDataStoreExtensionPrefix, validateExtensionKeys 
 - 
 
 - 
 
- 
- 
Field Detail
- 
ID_UNKNOWN
public static final int ID_UNKNOWN
Unknown identity type.- See Also:
 - Constant Field Values
 
 
- 
ID_DATASTORE
public static final int ID_DATASTORE
Datastore identity type.- See Also:
 - Constant Field Values
 
 
- 
ID_APPLICATION
public static final int ID_APPLICATION
Application identity type.- See Also:
 - Constant Field Values
 
 
- 
ACCESS_UNKNOWN
public static final int ACCESS_UNKNOWN
Unknown access type. 
- 
ACCESS_FIELD
public static final int ACCESS_FIELD
Persistent attributes are accessed via direct field access. Bit flag. 
- 
ACCESS_PROPERTY
public static final int ACCESS_PROPERTY
Persistent attributes are accessed via setters and getters. Bit flag. 
- 
ACCESS_EXPLICIT
public static final int ACCESS_EXPLICIT
Persistent class has explicitly defined an access type. This will allow the attributes to use mixed access i.e. some field may use ACCESS_FIELD while others ACCESS_PROPERTY. 
- 
SYNTHETIC
public static final String SYNTHETIC
Value for using a synthetic detached state field, which is the default.- See Also:
 - Constant Field Values
 
 
- 
DEFAULT_STRING
protected static final String DEFAULT_STRING
- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Constructor Detail
- 
ClassMetaData
protected ClassMetaData(Class<?> type, MetaDataRepository repos)
Constructor. Supply described type and repository. 
- 
ClassMetaData
protected ClassMetaData(ValueMetaData owner)
Embedded constructor. Supply embedding value. 
 - 
 
- 
Method Detail
- 
getRepository
public MetaDataRepository getRepository()
Return the owning repository.- Specified by:
 getRepositoryin interfaceMetaDataContext- Specified by:
 getRepositoryin classExtensions
 
- 
getEmbeddingMetaData
public ValueMetaData getEmbeddingMetaData()
If this metadata is for an embedded object, returning the owning value. 
- 
getDescribedType
public Class<?> getDescribedType()
The persistence capable class described by this metadata. 
- 
getDescribedTypeString
public String getDescribedTypeString()
The persistence capable stringified class described by this metadata. 
- 
setDescribedType
protected void setDescribedType(Class<?> type)
Set the class described by this metadata. The type may be reset when an embedded value changes its declared type. 
- 
getEnvClassLoader
public ClassLoader getEnvClassLoader()
The environmental loader used when loading this metadata. The class metadata should use this loader when loading metadata for its superclass and field types. 
- 
setEnvClassLoader
public void setEnvClassLoader(ClassLoader loader)
The class environmental loader used when loading this metadata. The class metadata should use this loader when loading metadata for its superclass and field types. 
- 
getPCSuperclass
public Class<?> getPCSuperclass()
The persistence capable superclass of the described type. 
- 
setPCSuperclass
public void setPCSuperclass(Class<?> pc)
The persistence capable superclass of the described type. 
- 
getPCSuperclassMetaData
public ClassMetaData getPCSuperclassMetaData()
The metadata for this class' superclass. 
- 
setPCSuperclassMetaData
public void setPCSuperclassMetaData(ClassMetaData meta)
The metadata for this class' superclass. 
- 
isMapped
public boolean isMapped()
Whether this class is mapped to the datastore. By default, only returns false if class is embedded-only, but subclasses might override to allow unmapped other types. 
- 
getMappedPCSuperclassMetaData
public ClassMetaData getMappedPCSuperclassMetaData()
Return the closest mapped superclass. 
- 
getPCSubclasses
public Class<?>[] getPCSubclasses()
Return the known persistence capable subclasses of the described type, or empty array if none or if this is embedded metadata. 
- 
getPCSubclassMetaDatas
public 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. 
- 
getMappedPCSubclassMetaDatas
public ClassMetaData[] getMappedPCSubclassMetaDatas()
Return all mapped subclasses. 
- 
getIdentityType
public int getIdentityType()
The type of identity being used. This will be one of: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 instance
ID_DATASTOREif there are no primary key fields, andID_APPLICATIONotherwise. 
- 
setIdentityType
public void setIdentityType(int type)
The type of identity being used. This will be one of: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 instance
ID_DATASTOREif there are no primary key fields, andID_APPLICATIONotherwise. 
- 
getObjectIdType
public Class<?> getObjectIdType()
The metadata-specified class to use for the object ID. 
- 
setObjectIdType
public void setObjectIdType(Class<?> cls, boolean shared)
The metadata-specified class to use for the object ID. When there is IdClass annotation, AnnotationMetaDataParser will call this method to set ObjectId type. However, if this is a derived identity in the child entity where a relation field (parent entity) is used as an id, and this relation field has an IdClass, the IdClass annotation in the child entity can be ignored as Openjpa will automatically wrap parent's IdClass as child's IdClass. 
- 
isObjectIdTypeShared
public boolean isObjectIdTypeShared()
Whether this type uses an application identity class that is shared with other classes, and is therefore wrapped in anObjectId. 
- 
isOpenJPAIdentity
public boolean isOpenJPAIdentity()
Whether this type uses OpenJPA identity. 
- 
getIdentityStrategy
public int getIdentityStrategy()
The strategy to use for datastore identity generation. One of the constants fromValueStrategies. 
- 
setIdentityStrategy
public void setIdentityStrategy(int strategy)
The strategy to use for datastore identity generation. One of the constants fromValueStrategies. 
- 
getIdentitySequenceName
public String getIdentitySequenceName()
The datastore identity sequence name, or null for none. 
- 
setIdentitySequenceName
public void setIdentitySequenceName(String seqName)
The datastore identity sequence name, or null for none. 
- 
getIdentitySequenceMetaData
public SequenceMetaData getIdentitySequenceMetaData()
Metadata for the datastore identity sequence. 
- 
getLifecycleMetaData
public LifecycleMetaData getLifecycleMetaData()
Information about lifecycle callbacks for this class. 
- 
getTypeAlias
public String getTypeAlias()
Returns the alias for the described type, ornullif none has been set.- See Also:
 setTypeAlias(java.lang.String)
 
- 
setTypeAlias
public void setTypeAlias(String alias)
Sets the alias for the described type. The alias can be any arbitrary string that the implementation can later use to refer to the class. Note that at runtime, only the alias computed when the persistent type was enhanced is used.- Parameters:
 alias- the alias name to apply to the described type
 
- 
getAccessType
public int getAccessType()
The access type used by this class. 
- 
setAccessType
public void setAccessType(int type)
Sets the access type. 
- 
isExplicitAccess
public boolean isExplicitAccess()
Affirms if access style is explicitly defined. 
- 
isMixedAccess
public boolean isMixedAccess()
Affirms if attributes of this class use mixed access types. 
- 
getRequiresExtent
public boolean getRequiresExtent()
Whether the type requires extent management. 
- 
setRequiresExtent
public void setRequiresExtent(boolean req)
Whether the type requires extent management. 
- 
isEmbeddedOnly
public boolean isEmbeddedOnly()
Whether the type can only be used as an embedded object. 
- 
setEmbeddedOnly
public void setEmbeddedOnly(boolean embed)
Whether the type can only be used as an embedded object. 
- 
isEmbeddable
public boolean isEmbeddable()
 
- 
setEmbeddable
public void setEmbeddable()
 
- 
isIntercepting
public boolean isIntercepting()
Whether the type's fields are actively intercepted, either by redefinition or enhancement. 
- 
setIntercepting
public void setIntercepting(boolean intercepting)
Whether the type's fields are actively intercepted, either by redefinition or enhancement. 
- 
isManagedInterface
public boolean isManagedInterface()
Whether the type is a managed interface. 
- 
setManagedInterface
public void setManagedInterface(boolean managedInterface)
Whether the type is a managed interface 
- 
getInterfaceImpl
public Class<?> getInterfaceImpl()
Return the managed interface implementor if any. 
- 
setInterfaceImpl
public void setInterfaceImpl(Class<?> impl)
Set the managed interface implementor class. 
- 
getDeclaredInterfaces
public Class<?>[] getDeclaredInterfaces()
Return all explicitly declared interfaces this class implements. 
- 
addDeclaredInterface
public void addDeclaredInterface(Class<?> iface)
Explicitly declare the given interface among the ones this class implements. 
- 
removeDeclaredInterface
public boolean removeDeclaredInterface(Class<?> iface)
Remove the given interface from the declared list. 
- 
setInterfacePropertyAlias
public void setInterfacePropertyAlias(Class<?> iface, String orig, String local)
Alias properties from the given interface during queries to the local field. 
- 
getInterfacePropertyAlias
public String getInterfacePropertyAlias(Class<?> iface, String orig)
Get local field alias for the given interface property. 
- 
getInterfaceAliasedProperties
public String[] getInterfaceAliasedProperties(Class<?> iface)
Return all aliases property named for the given interface. 
- 
getExtraFieldDataLength
public 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. 
- 
getExtraFieldDataIndex
public int getExtraFieldDataIndex(int field)
Return the intermediate field data index of the given field in the compacted array, or -1 if the field does not use extra data.- See Also:
 getExtraFieldDataLength()
 
- 
isAccessibleField
public boolean isAccessibleField(String field)
Return whether the given name represents a managed or static field of this class, including superclass fields. 
- 
getProxyFields
public FieldMetaData[] getProxyFields()
Return all fields that are types that need to be wrappered by a proxy. The types that need to be proxied are:- org.apache.openjpa.meta.JavaTypes.CALENDAR
 - org.apache.openjpa.meta.JavaTypes.COLLECTION
 - org.apache.openjpa.meta.JavaTypes.DATE
 - org.apache.openjpa.meta.JavaTypes.MAP
 - org.apache.openjpa.meta.JavaTypes.OBJECT
  
- 
getLrsFields
public FieldMetaData[] getLrsFields()
Return all large result set fields. Will never return null. 
- 
getFields
public FieldMetaData[] getFields()
Return all field metadata, including superclass fields. 
- 
getSuperclassField
protected FieldMetaData getSuperclassField(FieldMetaData supField)
Return the superclass copy of the given field. 
- 
getDeclaredFields
public FieldMetaData[] getDeclaredFields()
Return only the fields for this class, without superclass fields. 
- 
getPrimaryKeyFields
public FieldMetaData[] getPrimaryKeyFields()
Return primary key fields, or empty array if none. The order in which the keys are returned will be the order in which the fields are declared, starting at the least-derived superclass and ending with the primary key fields of the most-derived subclass. 
- 
getDefaultFetchGroupFields
public FieldMetaData[] getDefaultFetchGroupFields()
Return the list of fields in the default fetch group, including superclass fields, or an empty array if none. 
- 
getVersionField
public FieldMetaData getVersionField()
Return the version field for this class, if any. 
- 
getField
public FieldMetaData getField(int index)
Return the metadata for the persistent or transactional field with the given absolute index.- Returns:
 - the field's metadata, or null if not found
 
 
- 
getDeclaredField
public FieldMetaData getDeclaredField(int index)
Return the metadata for the persistent or transactional field with the given relative index.- Returns:
 - the field's metadata, or null if not found
 
 
- 
getField
public FieldMetaData getField(String name)
Return the metadata for the persistent or transactional field with the given name.- Returns:
 - the field's metadata, or null if not found
 
 
- 
getDeclaredField
public FieldMetaData getDeclaredField(String name)
Return the metadata for the persistent or transactional field with the given name, without including superclass fields.- Returns:
 - the field's metadata, or null if not found
 
 
- 
getDeclaredUnmanagedFields
public FieldMetaData[] getDeclaredUnmanagedFields()
Return any fields that were added as non-managed. All other methods to get fields return only those that are managed. 
- 
addDeclaredField
public FieldMetaData addDeclaredField(String name, Class<?> type)
Add a new field metadata to this class. 
- 
removeDeclaredField
public boolean removeDeclaredField(FieldMetaData field)
Remove the given field from management.- Returns:
 - true if the field was removed, false otherwise
 
 
- 
getDefinedSuperclassField
public FieldMetaData getDefinedSuperclassField(String name)
Return the defined superclass field with the given name, or null if none. 
- 
addDefinedSuperclassField
public FieldMetaData addDefinedSuperclassField(String name, Class<?> type, Class<?> sup)
Add a new defined superclass field metadata to this class. 
- 
removeDefinedSuperclassField
public boolean removeDefinedSuperclassField(FieldMetaData field)
Remove the given field from management.- Returns:
 - true if the field was removed, false otherwise
 
 
- 
defineSuperclassFields
public void defineSuperclassFields(boolean force)
Incorporate superclass fields redefined in this subclass into this metadata. This method is generally called after metadata is resolved and mapping information is loaded, but before mapping resolve.- Parameters:
 force- whether to force re-mapping of even mapped superclass fields
 
- 
getDefinedFields
public FieldMetaData[] getDefinedFields()
Returns an array of all the fields defined by this class. This includes mapped declared fields and any concrete mapping of unmapped superclass fields performed by this class. 
- 
getFieldsInListingOrder
public FieldMetaData[] getFieldsInListingOrder()
Returns all fields in the order they are listed in the metadata file. Unlisted fields are placed after listed ones. 
- 
getDefinedFieldsInListingOrder
public FieldMetaData[] getDefinedFieldsInListingOrder()
Returns all fields defined by this class in the order they are listed in the metadata file. Unlisted fields are placed after listed ones. This array includes declared transactional and unmanaged fields. 
- 
getDataCacheName
public String getDataCacheName()
The name of the data cache that stores the managed instance of this class, by default. This can be overwritten by per-instance basis cache distribution policy.- Returns:
 - null if this class is disabled from cache by @DataCache(enabled=false). default if @DataCache(enabled=true) without a name. Otherwise, data cache name set by the user via @DataCache name attribute.
 
 
- 
setDataCacheName
public void setDataCacheName(String name)
Set the cache name for this class.- Parameters:
 name- can benullto disable cache.
 
- 
getDataCacheEnabled
public boolean getDataCacheEnabled()
Affirms true if this receiver is annotated with @DataCache and is not disabled. A separate state variable is necessary besides the name of the cache defaulted to a special string. 
- 
getDataCacheTimeout
public int getDataCacheTimeout()
The cache timeout for this class. -1 indicates no timeout. 
- 
setDataCacheTimeout
public void setDataCacheTimeout(int timeout)
The cache timeout for this class. -1 indicates no timeout. 
- 
getDataCache
public DataCache getDataCache()
Return the data cache for this class, or null if it is not cachable. 
- 
isDetachable
public boolean isDetachable()
Whether instances are detachable. 
- 
setDetachable
public void setDetachable(boolean detachable)
Whether instances are detachable. 
- 
getDetachedState
public String getDetachedState()
The name of the detach state field, or null if none. 
- 
setDetachedState
public void setDetachedState(String field)
The name of the detach state field, or null if none. 
- 
getDetachedStateField
public Field getDetachedStateField()
Return the detach state field, or null if none. 
- 
usesDetachedState
public Boolean usesDetachedState()
Whether an instance of this type has detached state.- Returns:
 - true if a detached instance must have detached state, false if it does not, and null if it may use a manually-constructed instance without detached state
 
 
- 
clearAllFieldCache
protected void clearAllFieldCache()
Clear cached field data. 
- 
clearDefinedFieldCache
protected void clearDefinedFieldCache()
Clear defined field data. 
- 
clearFieldCache
protected void clearFieldCache()
Clear cached field data. 
- 
clearSubclassCache
protected void clearSubclassCache()
Clear cached subclass data. 
- 
compareTo
public int compareTo(ClassMetaData other)
- Specified by:
 compareToin interfaceComparable<ClassMetaData>
 
- 
getResolve
public int getResolve()
The resolve mode for this metadata. 
- 
setResolve
public void setResolve(int mode)
The resolve mode for this metadata. 
- 
setResolve
public void setResolve(int mode, boolean on)The resolve mode for this metadata. 
- 
resolve
public boolean resolve(int mode)
Resolve and validate metadata. Return true if already resolved. 
- 
resolveMeta
protected void resolveMeta(boolean runtime)
Resolve metadata. 
- 
validateMeta
protected void validateMeta(boolean runtime)
Validate resolved metadata. 
- 
resolveMapping
protected void resolveMapping(boolean runtime)
Resolve mapping data. Logs resolve message and resolves super by default. 
- 
validateMapping
protected void validateMapping(boolean runtime)
Validate mapping data. 
- 
initializeMapping
protected void initializeMapping()
Initialize mapping. Logs init message by default. 
- 
useIdClassFromParent
public boolean useIdClassFromParent()
Return true if this class uses IdClass derived from idClass of the parent entity which annotated as id in the child class. In this case, there are no key fields in the child entity corresponding to the fields in the IdClass. 
- 
getDeclaredFetchGroups
public FetchGroup[] getDeclaredFetchGroups()
Return the fetch groups declared explicitly in this type. 
- 
getCustomFetchGroups
public FetchGroup[] getCustomFetchGroups()
Return all fetch groups for this type, including superclass groups but excluding the standard groups such as "default" or "all". 
- 
getFetchGroup
public FetchGroup getFetchGroup(String name)
Gets a named fetch group. If not available in this receiver then looks up the inheritance hierarchy.- Parameters:
 name- name of a fetch group.- Returns:
 - an existing fetch group of the given name if known to this receiver or any of its superclasses. Otherwise null.
 
 
- 
addDeclaredFetchGroup
public FetchGroup addDeclaredFetchGroup(String name)
Adds fetch group of the given name, or returns existing instance.- Parameters:
 name- a non-null, non-empty name. Must be unique within this receiver's scope. The super class may have a group with the same name.
 
- 
removeDeclaredFetchGroup
public boolean removeDeclaredFetchGroup(FetchGroup fg)
Remove a declared fetch group. 
- 
getSourceFile
public File getSourceFile()
Description copied from interface:SourceTrackerReturn the file from which this instance was parsed.- Specified by:
 getSourceFilein interfaceSourceTracker
 
- 
getSourceScope
public Object getSourceScope()
Description copied from interface:SourceTrackerReturn the domain-dependent scope of this instance within its file.- Specified by:
 getSourceScopein interfaceSourceTracker
 
- 
getSourceType
public int getSourceType()
Description copied from interface:SourceTrackerReturn the type of source.- Specified by:
 getSourceTypein interfaceSourceTracker
 
- 
getResourceName
public String getResourceName()
Description copied from interface:SourceTrackerReturn the domain-meaningful name of the resource that was loaded from this source. I.e., if we had loaded the source for a Java class, this would return the name of the class.- Specified by:
 getResourceNamein interfaceSourceTracker
 
- 
getLineNumber
public int getLineNumber()
Description copied from interface:SourceTrackerReturn the line number of the file at which this instance was parsed.- Specified by:
 getLineNumberin interfaceSourceTracker
 
- 
setLineNumber
public void setLineNumber(int lineNum)
 
- 
getColNumber
public int getColNumber()
Description copied from interface:SourceTrackerReturn the column number in the line of the file at which this instance was parsed.- Specified by:
 getColNumberin interfaceSourceTracker
 
- 
setColNumber
public void setColNumber(int colNum)
 
- 
getSourceMode
public int getSourceMode()
The source mode this metadata has been loaded under. 
- 
setSourceMode
public void setSourceMode(int mode)
The source mode this metadata has been loaded under. 
- 
setSourceMode
public void setSourceMode(int mode, boolean on)The source mode this metadata has been loaded under. 
- 
getListingIndex
public int getListingIndex()
The index in which this class was listed in the metadata. Defaults to-1if this class was not listed in the metadata. 
- 
setListingIndex
public void setListingIndex(int index)
The index in which this field was listed in the metadata. Defaults to-1if this class was not listed in the metadata. 
- 
getComments
public String[] getComments()
Description copied from interface:CommentableReturn comments, or empty array if none.- Specified by:
 getCommentsin interfaceCommentable
 
- 
setComments
public void setComments(String[] comments)
Description copied from interface:CommentableSet comments.- Specified by:
 setCommentsin interfaceCommentable
 
- 
copy
public void copy(ClassMetaData meta)
Copy the metadata from the given instance to this one. Do not copy mapping information. 
- 
addExtensionKeys
protected void addExtensionKeys(Collection exts)
Description copied from class:ExtensionsAdd all the known extension keys to the specified collection; any implementation that utilized new extensions should override this method to include both the known extensions of its superclass as well as its own extension keys.- Overrides:
 addExtensionKeysin classExtensions
 
- 
registerForValueUpdate
public void registerForValueUpdate(String... values)
 
- 
valueChanged
public void valueChanged(Value val)
Description copied from interface:ValueListenerCallback used byValueobjects to notify listener of change.- Specified by:
 valueChangedin interfaceValueListener
 
- 
getFieldNames
public String[] getFieldNames()
Utility method to get names of all fields including the superclasses' sorted in lexical order. 
- 
getDeclaredFieldNames
public String[] getDeclaredFieldNames()
Utility method to get names of all declared fields excluding the superclasses' sorted in lexical order. 
- 
isAbstract
public boolean isAbstract()
 
- 
setAbstract
public void setAbstract(boolean flag)
 
- 
hasAbstractPKField
public boolean hasAbstractPKField()
Convenience method to determine if the pcType modeled by this ClassMetaData object is both abstract and declares PKFields. This method is used by the PCEnhancer to determine if special handling is required. 
- 
hasPKFieldsFromAbstractClass
public boolean hasPKFieldsFromAbstractClass()
Convenience method to determine if this type is a direct decendent of an abstract type declaring PKFields. Returns true if there are no pcTypes mapped to a table between this type and an abstract pcType declaring PKFields. Returns false if there no such abstract pcTypes in the inheritance hierarchy or if there are any pcTypes mapped to tables in between the type represented by this ClassMetaData object and the abstract pcType declaring PKFields. 
- 
setCacheEnabled
public void setCacheEnabled(boolean enabled)
Sets the eligibility status of this class for cache. 
- 
getCacheEnabled
public Boolean getCacheEnabled()
Returns tri-state status on whether this class has been enabled for caching.- Returns:
 - TRUE or FALSE denote this class has been explicitly enabled or disabled for caching. If no status has been explicitly set, then the status of the persistent super class, if any, is returned.
 
 
- 
getSourceName
public String getSourceName()
 
- 
getPkAndNonPersistentManagedFmdIndexes
public int[] getPkAndNonPersistentManagedFmdIndexes()
 
- 
hasInverseManagedFields
public boolean hasInverseManagedFields()
 
- 
getMappyedByIdFields
public List<FieldMetaData> getMappyedByIdFields()
 
- 
getUseSchemaElement
public boolean getUseSchemaElement()
Set whether to include schema name in generated class files 
- 
setUseSchemaElement
public void setUseSchemaElement(boolean useSchemaElement)
Get whether to include schema name in generated class files 
- 
getIdClass
public Class<?> getIdClass()
The class specified with the @IdClass annotation if used 
 - 
 
 -