Package org.apache.openjpa.meta
Class FieldMetaData
java.lang.Object
org.apache.openjpa.meta.Extensions
org.apache.openjpa.meta.FieldMetaData
- All Implemented Interfaces:
Serializable
,Commentable
,MetaDataContext
,MetaDataModes
,ValueMetaData
- Direct Known Subclasses:
FieldMapping
public class FieldMetaData
extends Extensions
implements ValueMetaData, MetaDataContext, MetaDataModes, Commentable
Metadata for a managed class field.
- Author:
- Abe White
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Constant specifying the management level of a field.static final int
Constant specifying the management level of a field.static final int
Constant specifying the management level of a field.static final int
static final int
static final int
Constant specifying to use a datastore default value to persist null values in object fields.static final int
Constant specifying to throw an exception when attempting to persist null values in object fields.static final int
Constant specifying to use a datastore null to persist null values in object fields.static final int
Constant specifying that no null-value was given.static final int
static final int
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.meta.ValueMetaData
CASCADE_AUTO, CASCADE_IMMEDIATE, CASCADE_NONE, MAPPED_BY_PK
-
Constructor Summary
ModifierConstructorDescriptionprotected
FieldMetaData
(String name, Class<?> type, ClassMetaData owner) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionAdd embedded metadata for this value.addEmbeddedMetaData
(int access) Add embedded metadata for this value with the given access typeprotected void
addExtensionKeys
(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.void
backingMember
(Member member) Supply the backing member object; this allows us to utilize parameterized type information if available.int
void
copy
(FieldMetaData field) Copy state from the given field to this one.void
copy
(ValueMetaData vmd) Copy state from the given value to this one.boolean
int
Gets the access type used by this field.int
Return the backing member supplied inbackingMember(java.lang.reflect.Member)
.int
Cascade behavior for attach operation.int
Cascade behavior for delete operation.int
Cascade behavior for detach operation.int
Cascade behavior for persist operation.int
Cascade behavior for refresh operation.String[]
Return comments, or empty array if none.String[]
Gets the name of the custom fetch groups those are associated to this receiver.int
The relative index of this persistent/transactional field.Return the declared class of the value.int
Return the declared type code of the value.Return metadata for the value's class, if the type is persistent.The declaring class.Class<?>
The declaring class.The class that defines the metadata for this field.Metadata about the element value.The embedded class metadata for the value.The name of this field's externalizer, or null if none.The externalizer method.getExternalValue
(Object val, StoreContext ctx) Convert the given field value to its external value through the provided externalizer, or return the value as-is if no externalizer.Return the mapping of field values to external values.Properties string mapping field values to external values.The name of this field's factory, or null if none.The factory method or constructor.Return the owning field for this value.getFieldValue
(Object val, StoreContext ctx) Return the result of passing the given external value through the factory to get the field value.Return the mapping of external values to field values.Deprecated.Use getFullName(boolean) instead.getFullName
(boolean embedOwner) The field name, qualified by the owning class and optionally the embedding owner's name (if any).int
getIndex()
The absolute index of this persistent/transactional field.The initializer used by the field, or null if none.Logical inverse field.Return all inverses of this field.getKey()
Metadata about the key value.int
The index in which this field was listed in the metadata.The fetch group that is to be loaded when this receiver is loaded, or null if none set.int
Return the management level for the field.The field that this field shares a mapping with.getMappedByField
(ClassMetaData meta, String mappedBy) The field that this field shares a mapping with.getName()
The field name.int
How the data store should treat null values for this field:NULL_UNSET
: no value suppliedNULL_NONE
: leave null values as null in the data storeNULL_EXCEPTION
: throw an exception if this field is null at commitNULL_DEFAULT
: use the database default if this field is null at commit Defaults toNULL_UNSET
.Class<?>
For a primary key field, return the type of the corresponding object id class field.int
For a primary key field, return the type of the corresponding object id class field.String declaring the orderings for this field to be applied on load, or null.Order[]
The orderings for this field to be applied on load, or empty array.int
The absolute primary key index for this field, or -1 if not a primary key.Class<?>
The type this field was initialized with, and therefore the type to use for proxies when loading data into this field.The field name, qualified by the defining class.Class<?>
The metadata repository.int
Resolve mode for this field.getType()
The value class.int
The type code of the value class.The metadata for the value class, if the type is persistent.Class<?>
User-supplied type overriding assumed type based on field.int
The strategy to use when updating the field.boolean
Whether to include schema name in generated filesgetValue()
MetaData about the field value.The field that this value shares a mapping with.The field that this value shares a mapping with.Metadata for the value sequence.The value sequence name, or null for none.int
The strategy to use for insert value generation.int
hashCode()
boolean
Whether the type is a persistence capable instance.boolean
Whether the default fetch group setting is explicit.boolean
boolean
boolean
This attribute is a hint to the implementation to store this value in the same structure as the class, rather than as a separate datastore structure.boolean
Whether this is an embedded persistence capable value.boolean
Whether this field is explicitly declared in the metadata.boolean
Whether the field is externalized.boolean
Whether this field is in the default fetch group.boolean
isInFetchGroup
(String fg) Whether this field is in the given fetch group.boolean
isLRS()
Whether this field is backed by a large result set.boolean
isMapped()
Return whether this field is mapped to the datastore.boolean
boolean
boolean
Whether this is a primary key field.boolean
Whether this value is serialized when stored.boolean
isStream()
Whether this field is backed by a stream.boolean
Return whether this is a transient field.boolean
isTypePC()
Whether the type is a persistence capable instance.boolean
Check if this field is used by other field as "order by" value.boolean
boolean
Whether this field holds optimistic version information.Order this field value when it is loaded.boolean
resolve
(int mode) Resolve and validate metadata.void
setAccessType
(int fCode) Sets access type of this field.void
setAssociationType
(int type) void
setCascadeAttach
(int attach) Cascade behavior for attach operation.void
setCascadeDelete
(int delete) Cascade behavior for deletion.void
setCascadeDetach
(int detach) Cascade behavior for detach operation.void
setCascadePersist
(int persist) Cascade behavior for persist operation.void
setCascadePersist
(int cascade, boolean checkPUDefault) Cascade behavior for persist operation.void
setCascadeRefresh
(int refresh) Cascade behavior for refresh operation.void
setComments
(String[] comments) Set comments.void
setConverter
(Class converter) void
setDeclaredIndex
(int index) The relative index of this persistent/transactional field.void
setDeclaredType
(Class type) Set the declared class of the value.void
setDeclaredTypeCode
(int type) Set the type code for the value.void
setDeclaringType
(Class<?> cls) The declaring class.void
setDefaultFetchGroupExplicit
(boolean explicit) Whether the default fetch group setting is explicit.void
setDelayCapable
(Boolean delayCapable) void
setElementCollection
(boolean isElementCollection) void
setEmbedded
(boolean embedded) This attribute is a hint to the implementation to store this value in the same structure as the class, rather than as a separate datastore structure.void
setExplicit
(boolean explicit) Whether this field is explicitly declared in the metadata.void
setExternalizer
(String externalizer) The name of this field's externalizer, or null if none.void
setExternalValues
(String values) Properties string mapping field values to external values.void
setFactory
(String factory) The name of this field's factory, or null if none.void
setInDefaultFetchGroup
(boolean dfg) Whether this field is in the default fetch group.void
setIndex
(int index) The absolute index of this persistent/transactional field.void
setInFetchGroup
(String fg, boolean in) Set whether this field is in the given fetch group.void
setInitializer
(Object initializer) The initializer used by the field, or null if none.void
setInverse
(String inverse) Logical inverse field.void
setListingIndex
(int index) The index in which this field was listed in the metadata.void
setLoadFetchGroup
(String lfg) The fetch group that is to be loaded when this receiver is loaded, or null if none set.void
setLRS
(boolean lrs) Whether this field is backed by a large result set.void
setManagement
(int manage) Return the management level for the field.void
setMappedBy
(String mapped) The field that this field shares a mapping with.void
setMappedByIdValue
(String mappedByIdValue) void
setNullValue
(int nullValue) How the data store should treat null values for this field:NULL_UNSET
: no value suppliedNULL_NONE
: leave null values as null in the data storeNULL_EXCEPTION
: throw an exception if this field is null at commitNULL_DEFAULT
: use the database default if this field is null at commit Defaults toNULL_UNSET
.void
String declaring the orderings for this field to be applied on load, or null.void
The orderings for this field to be applied on load.void
setPersistentCollection
(boolean persistentCollection) void
setPrimaryKey
(boolean primKey) Whether this is a primary key field.void
setPrimaryKeyIndex
(int index) The absolute primary key index for this field, or -1 if not a primary key.void
setProxyType
(Class<?> type) The type this field was initialized with, and therefore the type to use for proxies when loading data into this field.void
setResolve
(int mode) Resolve mode for this field.void
setResolve
(int mode, boolean on) Resolve mode for this field.void
setSerialized
(boolean serialized) Whether this value is serialized when stored.void
setStream
(boolean stream) Whether this field is backed by a stream.void
setTransient
(boolean trans) Return whether this is a transient field.void
The value class.void
setTypeCode
(int code) The type code of the value class.void
setTypeOverride
(Class type) User-supplied type overriding assumed type based on field.void
setUpdateStrategy
(int strategy) Set the update strategy.void
setUsedInOrderBy
(boolean isUsed) Whether this field is used by other field as "order by" value .void
setUseSchemaElement
(boolean _useSchemaElement) Whether to include schema name in generated filesvoid
setUsesImplData
(Boolean implData) Whether this field uses impl data in conjunction with standard field data when acting on aOpenJPAStateManager
.void
setUsesIntermediate
(boolean intermediate) Whether this field uses intermediate data when loading/storing information through aOpenJPAStateManager
.void
setValueGenerated
(boolean generated) void
setValueMappedBy
(String mapped) The field that this value shares a mapping with.void
setValueSequenceName
(String seqName) The value sequence name, or null for none.void
setValueStrategy
(int strategy) The strategy to use for insert value generation.void
setVersion
(boolean version) Whether this field holds optimistic version information.toString()
Whether this field uses impl data in conjunction with standard field data when acting on aOpenJPAStateManager
.boolean
Whether this field uses intermediate data when loading/storing information through aOpenJPAStateManager
.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 Details
-
NULL_UNSET
public static final int NULL_UNSETConstant specifying that no null-value was given.- See Also:
-
NULL_NONE
public static final int NULL_NONEConstant specifying to use a datastore null to persist null values in object fields.- See Also:
-
NULL_DEFAULT
public static final int NULL_DEFAULTConstant specifying to use a datastore default value to persist null values in object fields.- See Also:
-
NULL_EXCEPTION
public static final int NULL_EXCEPTIONConstant specifying to throw an exception when attempting to persist null values in object fields.- See Also:
-
MANAGE_PERSISTENT
public static final int MANAGE_PERSISTENTConstant specifying the management level of a field.- See Also:
-
MANAGE_TRANSACTIONAL
public static final int MANAGE_TRANSACTIONALConstant specifying the management level of a field.- See Also:
-
MANAGE_NONE
public static final int MANAGE_NONEConstant specifying the management level of a field.- See Also:
-
ONE_TO_ONE
public static final int ONE_TO_ONE- See Also:
-
ONE_TO_MANY
public static final int ONE_TO_MANY- See Also:
-
MANY_TO_ONE
public static final int MANY_TO_ONE- See Also:
-
MANY_TO_MANY
public static final int MANY_TO_MANY- See Also:
-
-
Constructor Details
-
FieldMetaData
Constructor.- Parameters:
name
- the field nametype
- the field typeowner
- the owning class metadata
-
-
Method Details
-
backingMember
Supply the backing member object; this allows us to utilize parameterized type information if available. Sets the access style of this receiver based on whether the given member represents a field or getter method. -
getBackingMember
Return the backing member supplied inbackingMember(java.lang.reflect.Member)
. -
getRepository
The metadata repository.- Specified by:
getRepository
in interfaceMetaDataContext
- Specified by:
getRepository
in classExtensions
-
getDefiningMetaData
The class that defines the metadata for this field. -
getDeclaringType
The declaring class. -
setDeclaringType
The declaring class. -
getDeclaringMetaData
The declaring class. -
getName
The field name. -
getFullName
Deprecated.Use getFullName(boolean) instead.The field name, qualified by the owning class. -
getFullName
The field name, qualified by the owning class and optionally the embedding owner's name (if any). -
getRealName
The field name, qualified by the defining class. -
getValue
MetaData about the field value. -
getKey
Metadata about the key value. -
getElement
Metadata about the element value. -
isMapped
public boolean isMapped()Return whether this field is mapped to the datastore. By default, returns true for all persistent fields whose defining class is mapped. -
getProxyType
The type this field was initialized with, and therefore the type to use for proxies when loading data into this field. -
setProxyType
The type this field was initialized with, and therefore the type to use for proxies when loading data into this field. -
getInitializer
The initializer used by the field, or null if none. This is additional information for initializing the field, such as a customComparator
used by aSet
or aTimeZone
used by aCalendar
. -
setInitializer
The initializer used by the field, or null if none. This is additional information for initializing the field, such as a customComparator
used by aSet
or aTimeZone
used by aCalendar
. -
isTransient
public boolean isTransient()Return whether this is a transient field. -
setTransient
public void setTransient(boolean trans) Return whether this is a transient field. -
getIndex
public int getIndex()The absolute index of this persistent/transactional field. -
setIndex
public void setIndex(int index) The absolute index of this persistent/transactional field. -
getDeclaredIndex
public int getDeclaredIndex()The relative index of this persistent/transactional field. -
setDeclaredIndex
public void setDeclaredIndex(int index) The relative index of this persistent/transactional field. -
getListingIndex
public int getListingIndex()The index in which this field was listed in the metadata. Defaults to-1
if this field 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-1
if this field was not listed in the metadata. -
getPrimaryKeyIndex
public int getPrimaryKeyIndex()The absolute primary key index for this field, or -1 if not a primary key. The first primary key field has index 0, the second index 1, etc. -
setPrimaryKeyIndex
public void setPrimaryKeyIndex(int index) The absolute primary key index for this field, or -1 if not a primary key. The first primary key field has index 0, the second index 1, etc. -
getManagement
public int getManagement()Return the management level for the field. Will be one of:MANAGE_PERSISTENT
: the field is persistentMANAGE_TRANSACTIONAL
: the field is transactional but not persistentMANAGE_NONE
: the field is not managed
MANAGE_PERSISTENT
. -
setManagement
public void setManagement(int manage) Return the management level for the field. Will be one of:MANAGE_PERSISTENT
: the field is persistentMANAGE_TRANSACTIONAL
: the field is transactional but not persistentMANAGE_NONE
: the field is not managed
MANAGE_PERSISTENT
. -
isPrimaryKey
public boolean isPrimaryKey()Whether this is a primary key field. -
setPrimaryKey
public void setPrimaryKey(boolean primKey) Whether this is a primary key field. -
getObjectIdFieldTypeCode
public int getObjectIdFieldTypeCode()For a primary key field, return the type of the corresponding object id class field. -
getObjectIdFieldType
For a primary key field, return the type of the corresponding object id class field. -
isVersion
public boolean isVersion()Whether this field holds optimistic version information. -
setVersion
public void setVersion(boolean version) Whether this field holds optimistic version information. -
isInDefaultFetchGroup
public boolean isInDefaultFetchGroup()Whether this field is in the default fetch group. -
setInDefaultFetchGroup
public void setInDefaultFetchGroup(boolean dfg) Whether this field is in the default fetch group. -
isDefaultFetchGroupExplicit
public boolean isDefaultFetchGroupExplicit()Whether the default fetch group setting is explicit. -
setDefaultFetchGroupExplicit
public void setDefaultFetchGroupExplicit(boolean explicit) Whether the default fetch group setting is explicit. Allow setting for testing. -
getCustomFetchGroups
Gets the name of the custom fetch groups those are associated to this receiver. This does not include the "default" and "all" fetch groups.- Returns:
- the set of fetch group names, not including the default and all fetch groups.
-
getLoadFetchGroup
The fetch group that is to be loaded when this receiver is loaded, or null if none set. -
setLoadFetchGroup
The fetch group that is to be loaded when this receiver is loaded, or null if none set. -
isInFetchGroup
Whether this field is in the given fetch group. -
setInFetchGroup
Set whether this field is in the given fetch group.- Parameters:
fg
- is the name of a fetch group that must be present in the class that declared this field or any of its persistent superclasses.
-
getNullValue
public int getNullValue()How the data store should treat null values for this field:NULL_UNSET
: no value suppliedNULL_NONE
: leave null values as null in the data storeNULL_EXCEPTION
: throw an exception if this field is null at commitNULL_DEFAULT
: use the database default if this field is null at commit
NULL_UNSET
. -
setNullValue
public void setNullValue(int nullValue) How the data store should treat null values for this field:NULL_UNSET
: no value suppliedNULL_NONE
: leave null values as null in the data storeNULL_EXCEPTION
: throw an exception if this field is null at commitNULL_DEFAULT
: use the database default if this field is null at commit
NULL_UNSET
. -
isExplicit
public boolean isExplicit()Whether this field is explicitly declared in the metadata. -
setExplicit
public void setExplicit(boolean explicit) Whether this field is explicitly declared in the metadata. -
getMappedBy
The field that this field shares a mapping with. -
setMappedBy
The field that this field shares a mapping with. -
getMappedByMetaData
The field that this field shares a mapping with. -
getMappedByField
-
getInverse
Logical inverse field. -
setInverse
Logical inverse field. -
getInverseMetaDatas
Return all inverses of this field. -
getValueStrategy
public int getValueStrategy()The strategy to use for insert value generation. One of the constants fromValueStrategies
. -
setValueStrategy
public void setValueStrategy(int strategy) The strategy to use for insert value generation. One of the constants fromValueStrategies
. -
getValueSequenceName
The value sequence name, or null for none. -
setValueSequenceName
The value sequence name, or null for none. -
getValueSequenceMetaData
Metadata for the value sequence. -
getUpdateStrategy
public int getUpdateStrategy()The strategy to use when updating the field. -
setUpdateStrategy
public void setUpdateStrategy(int strategy) Set the update strategy. -
isLRS
public boolean isLRS()Whether this field is backed by a large result set. -
setLRS
public void setLRS(boolean lrs) Whether this field is backed by a large result set. -
isStream
public boolean isStream()Whether this field is backed by a stream.- Since:
- 1.1.0
-
setStream
public void setStream(boolean stream) Whether this field is backed by a stream.- Since:
- 1.1.0
-
usesIntermediate
public boolean usesIntermediate()Whether this field uses intermediate data when loading/storing information through aOpenJPAStateManager
. Defaults to true. -
setUsesIntermediate
public void setUsesIntermediate(boolean intermediate) Whether this field uses intermediate data when loading/storing information through aOpenJPAStateManager
. Defaults to true. -
usesImplData
Whether this field uses impl data in conjunction with standard field data when acting on aOpenJPAStateManager
. Defaults toBoolean.TRUE
(non-cachable impl data).- Returns:
Boolean.FALSE
if this field does not use impl data,Boolean.TRUE
if this field uses non-cachable impl data, ornull
if this field uses impl data that should be cached across instances- See Also:
-
setUsesImplData
Whether this field uses impl data in conjunction with standard field data when acting on aOpenJPAStateManager
. -
getOrders
The orderings for this field to be applied on load, or empty array. -
setOrders
The orderings for this field to be applied on load. -
getOrderDeclaration
String declaring the orderings for this field to be applied on load, or null. The string is of the form:
orderable[ asc|desc][, ...]
The orderable#element
is used to denote the value of the field's elements. -
setOrderDeclaration
String declaring the orderings for this field to be applied on load, or null. The string is of the form:
orderable[ asc|desc][, ...]
The orderable#element
is used to denote the value of the field's elements. -
order
Order this field value when it is loaded. -
isExternalized
public boolean isExternalized()Whether the field is externalized. -
getExternalValue
Convert the given field value to its external value through the provided externalizer, or return the value as-is if no externalizer. -
getFieldValue
Return the result of passing the given external value through the factory to get the field value. If no factory is present, the given value is returned as-is. -
getExternalizer
The name of this field's externalizer, or null if none. -
setExternalizer
The name of this field's externalizer, or null if none. -
setConverter
-
getFactory
The name of this field's factory, or null if none. -
setFactory
The name of this field's factory, or null if none. -
getExternalValues
Properties string mapping field values to external values. -
setExternalValues
Properties string mapping field values to external values. -
getExternalValueMap
Return the mapping of field values to external values. -
getFieldValueMap
Return the mapping of external values to field values. -
getExternalizerMethod
The externalizer method. -
getFactoryMethod
The factory method or constructor. -
equals
-
hashCode
public int hashCode() -
compareTo
-
toString
-
getResolve
public int getResolve()Resolve mode for this field.- Specified by:
getResolve
in interfaceValueMetaData
-
setResolve
public void setResolve(int mode) Resolve mode for this field.- Specified by:
setResolve
in interfaceValueMetaData
-
setResolve
public void setResolve(int mode, boolean on) Resolve mode for this field.- Specified by:
setResolve
in interfaceValueMetaData
-
resolve
public boolean resolve(int mode) Resolve and validate metadata. Return true if already resolved.- Specified by:
resolve
in interfaceValueMetaData
-
copy
Copy state from the given field to this one. Do not copy mapping information. -
addExtensionKeys
Description copied from class:Extensions
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.- Overrides:
addExtensionKeys
in classExtensions
-
getComments
Description copied from interface:Commentable
Return comments, or empty array if none.- Specified by:
getComments
in interfaceCommentable
-
setComments
Description copied from interface:Commentable
Set comments.- Specified by:
setComments
in interfaceCommentable
-
getFieldMetaData
Description copied from interface:ValueMetaData
Return the owning field for this value.- Specified by:
getFieldMetaData
in interfaceValueMetaData
-
getType
Description copied from interface:ValueMetaData
The value class.- Specified by:
getType
in interfaceValueMetaData
-
setType
Description copied from interface:ValueMetaData
The value class.- Specified by:
setType
in interfaceValueMetaData
-
getTypeCode
public int getTypeCode()Description copied from interface:ValueMetaData
The type code of the value class.- Specified by:
getTypeCode
in interfaceValueMetaData
-
setTypeCode
public void setTypeCode(int code) Description copied from interface:ValueMetaData
The type code of the value class.- Specified by:
setTypeCode
in interfaceValueMetaData
-
isTypePC
public boolean isTypePC()Description copied from interface:ValueMetaData
Whether the type is a persistence capable instance.- Specified by:
isTypePC
in interfaceValueMetaData
-
getTypeMetaData
Description copied from interface:ValueMetaData
The metadata for the value class, if the type is persistent.- Specified by:
getTypeMetaData
in interfaceValueMetaData
-
getDeclaredType
Description copied from interface:ValueMetaData
Return the declared class of the value. This can differ from the return value ofValueMetaData.getType()
if the user indicates a different type or the value has an externalizer.- Specified by:
getDeclaredType
in interfaceValueMetaData
-
setDeclaredType
Description copied from interface:ValueMetaData
Set the declared class of the value.- Specified by:
setDeclaredType
in interfaceValueMetaData
-
getDeclaredTypeCode
public int getDeclaredTypeCode()Description copied from interface:ValueMetaData
Return the declared type code of the value. This can differ from the return value ofValueMetaData.getTypeCode()
if the user indicates a different type or the value has an externalizer.- Specified by:
getDeclaredTypeCode
in interfaceValueMetaData
-
setDeclaredTypeCode
public void setDeclaredTypeCode(int type) Description copied from interface:ValueMetaData
Set the type code for the value. The type code is usually computed automatically, but it can be useful to set it explicitly when creating metadatas from scratch.- Specified by:
setDeclaredTypeCode
in interfaceValueMetaData
-
isDeclaredTypePC
public boolean isDeclaredTypePC()Description copied from interface:ValueMetaData
Whether the type is a persistence capable instance.- Specified by:
isDeclaredTypePC
in interfaceValueMetaData
-
getDeclaredTypeMetaData
Description copied from interface:ValueMetaData
Return metadata for the value's class, if the type is persistent.- Specified by:
getDeclaredTypeMetaData
in interfaceValueMetaData
-
isEmbedded
public boolean isEmbedded()Description copied from interface:ValueMetaData
This attribute is a hint to the implementation to store this value in the same structure as the class, rather than as a separate datastore structure. Defaults to true if the field is not a collection or map or persistence-capable object; defaults to false otherwise. Implementations are permitted to ignore this attribute.- Specified by:
isEmbedded
in interfaceValueMetaData
-
setEmbedded
public void setEmbedded(boolean embedded) Description copied from interface:ValueMetaData
This attribute is a hint to the implementation to store this value in the same structure as the class, rather than as a separate datastore structure. Defaults to true if the field is not a collection or map or persistence-capable objects; defaults to false otherwise. Implementations are permitted to ignore this attribute.- Specified by:
setEmbedded
in interfaceValueMetaData
-
isEmbeddedPC
public boolean isEmbeddedPC()Description copied from interface:ValueMetaData
Whether this is an embedded persistence capable value.- Specified by:
isEmbeddedPC
in interfaceValueMetaData
-
getEmbeddedMetaData
Description copied from interface:ValueMetaData
The embedded class metadata for the value.- Specified by:
getEmbeddedMetaData
in interfaceValueMetaData
-
addEmbeddedMetaData
Description copied from interface:ValueMetaData
Add embedded metadata for this value with the given access type- Specified by:
addEmbeddedMetaData
in interfaceValueMetaData
-
addEmbeddedMetaData
Description copied from interface:ValueMetaData
Add embedded metadata for this value.- Specified by:
addEmbeddedMetaData
in interfaceValueMetaData
-
getCascadeDelete
public int getCascadeDelete()Description copied from interface:ValueMetaData
Cascade behavior for delete operation. Only applies to persistence-capable values. Options are:
CASCADE_NONE
: No cascades.CASCADE_IMMEDIATE
: Value is deleted immediately when the owning object is deleted.CASCADE_AUTO
: Value will be deleted on flush if the owning object is deleted or if the value is removed from the owning object, and if the value is not assigned to another relation in the same transaction.
- Specified by:
getCascadeDelete
in interfaceValueMetaData
-
setCascadeDelete
public void setCascadeDelete(int delete) Description copied from interface:ValueMetaData
Cascade behavior for deletion.- Specified by:
setCascadeDelete
in interfaceValueMetaData
- See Also:
-
getCascadePersist
public int getCascadePersist()Description copied from interface:ValueMetaData
Cascade behavior for persist operation. Only applies to persistence-capable values. Options are:
CASCADE_NONE
: No cascades. If a transient relation is held at flush, an error is thrown.CASCADE_IMMEDIATE
: Value is persisted immediately when the owning object is persisted.CASCADE_AUTO
: Value will be persisted on flush.
- Specified by:
getCascadePersist
in interfaceValueMetaData
-
setCascadePersist
public void setCascadePersist(int persist) Description copied from interface:ValueMetaData
Cascade behavior for persist operation.- Specified by:
setCascadePersist
in interfaceValueMetaData
- See Also:
-
setCascadePersist
public void setCascadePersist(int cascade, boolean checkPUDefault) Description copied from interface:ValueMetaData
Cascade behavior for persist operation.- Specified by:
setCascadePersist
in interfaceValueMetaData
- See Also:
-
getCascadeAttach
public int getCascadeAttach()Description copied from interface:ValueMetaData
Cascade behavior for attach operation. Only applies to persistence-capable values. Options are:
CASCADE_NONE
: No cascades of attach. Relation remains detached.CASCADE_IMMEDIATE
: Value is attached immediately.
- Specified by:
getCascadeAttach
in interfaceValueMetaData
-
setCascadeAttach
public void setCascadeAttach(int attach) Description copied from interface:ValueMetaData
Cascade behavior for attach operation.- Specified by:
setCascadeAttach
in interfaceValueMetaData
- See Also:
-
getCascadeDetach
public int getCascadeDetach()Description copied from interface:ValueMetaData
Cascade behavior for detach operation. Only applies to persistence-capable values. Options are:
CASCADE_NONE
: No cascades of detach. Relation remains attached.CASCADE_IMMEDIATE
: Value is detached immediately.
- Specified by:
getCascadeDetach
in interfaceValueMetaData
-
setCascadeDetach
public void setCascadeDetach(int detach) Description copied from interface:ValueMetaData
Cascade behavior for detach operation.- Specified by:
setCascadeDetach
in interfaceValueMetaData
- See Also:
-
getCascadeRefresh
public int getCascadeRefresh()Description copied from interface:ValueMetaData
Cascade behavior for refresh operation. Only applies to persistence-capable values. Options are:
CASCADE_NONE
: No cascades of refresh.CASCADE_IMMEDIATE
: Persistent value object is also refreshed.CASCADE_AUTO
: Value will be refreshed if it is in the current fetch groups.
- Specified by:
getCascadeRefresh
in interfaceValueMetaData
-
setCascadeRefresh
public void setCascadeRefresh(int refresh) Description copied from interface:ValueMetaData
Cascade behavior for refresh operation.- Specified by:
setCascadeRefresh
in interfaceValueMetaData
- See Also:
-
isSerialized
public boolean isSerialized()Description copied from interface:ValueMetaData
Whether this value is serialized when stored.- Specified by:
isSerialized
in interfaceValueMetaData
-
setSerialized
public void setSerialized(boolean serialized) Description copied from interface:ValueMetaData
Whether this value is serialized when stored.- Specified by:
setSerialized
in interfaceValueMetaData
-
getValueMappedBy
Description copied from interface:ValueMetaData
The field that this value shares a mapping with. Currently the only supported use for a mapped-by value is when a map field key is determined by a field of the persistence-capable map value.- Specified by:
getValueMappedBy
in interfaceValueMetaData
-
setValueMappedBy
Description copied from interface:ValueMetaData
The field that this value shares a mapping with. Currently the only supported use for a mapped-by value is when a map field key is determined by a field of the persistence-capable map value.- Specified by:
setValueMappedBy
in interfaceValueMetaData
-
getValueMappedByMetaData
Description copied from interface:ValueMetaData
The field that this value shares a mapping with. Currently the only supported use for a mapped-by value is when a map field key is determined by a field of the persistence-capable map value.- Specified by:
getValueMappedByMetaData
in interfaceValueMetaData
-
getTypeOverride
Description copied from interface:ValueMetaData
User-supplied type overriding assumed type based on field.- Specified by:
getTypeOverride
in interfaceValueMetaData
-
setTypeOverride
Description copied from interface:ValueMetaData
User-supplied type overriding assumed type based on field.- Specified by:
setTypeOverride
in interfaceValueMetaData
-
copy
Description copied from interface:ValueMetaData
Copy state from the given value to this one. Do not copy mapping information.- Specified by:
copy
in interfaceValueMetaData
-
isUsedInOrderBy
public boolean isUsedInOrderBy()Check if this field is used by other field as "order by" value.- Since:
- 1.1.0
-
setUsedInOrderBy
public void setUsedInOrderBy(boolean isUsed) Whether this field is used by other field as "order by" value .- Since:
- 1.1.0
-
isValueGenerated
public boolean isValueGenerated() -
setValueGenerated
public void setValueGenerated(boolean generated) -
isElementCollection
public boolean isElementCollection() -
setElementCollection
public void setElementCollection(boolean isElementCollection) -
getMappedByIdValue
-
setMappedByIdValue
-
isMappedById
public boolean isMappedById() -
getAccessType
public int getAccessType()Gets the access type used by this field. If no access type is set for this field then return the access type used by the declaring class. -
setAccessType
public void setAccessType(int fCode) Sets access type of this field. The access code is verified for validity as well as against the access style used by the declaring class. -
getAssociationType
public int getAssociationType() -
setAssociationType
public void setAssociationType(int type) -
isPersistentCollection
public boolean isPersistentCollection() -
setPersistentCollection
public void setPersistentCollection(boolean persistentCollection) -
getRelationType
-
isDelayCapable
public boolean isDelayCapable() -
setDelayCapable
-
getUseSchemaElement
public boolean getUseSchemaElement()Whether to include schema name in generated files -
setUseSchemaElement
public void setUseSchemaElement(boolean _useSchemaElement) Whether to include schema name in generated files -
getSetterName
-
getConverter
-