Package org.apache.openjpa.meta
Class FieldMetaData
- java.lang.Object
-
- org.apache.openjpa.meta.Extensions
-
- org.apache.openjpa.meta.FieldMetaData
-
- All Implemented Interfaces:
java.io.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:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFieldMetaData.MemberProviderSerializable wrapper around aMethodorField.
-
Field Summary
Fields Modifier and Type Field Description static intMANAGE_NONEConstant specifying the management level of a field.static intMANAGE_PERSISTENTConstant specifying the management level of a field.static intMANAGE_TRANSACTIONALConstant specifying the management level of a field.static intMANY_TO_MANYstatic intMANY_TO_ONEstatic intNULL_DEFAULTConstant specifying to use a datastore default value to persist null values in object fields.static intNULL_EXCEPTIONConstant specifying to throw an exception when attempting to persist null values in object fields.static intNULL_NONEConstant specifying to use a datastore null to persist null values in object fields.static intNULL_UNSETConstant specifying that no null-value was given.static intONE_TO_MANYstatic intONE_TO_ONE-
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
Constructors Modifier Constructor Description protectedFieldMetaData(java.lang.String name, java.lang.Class<?> type, ClassMetaData owner)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ClassMetaDataaddEmbeddedMetaData()Add embedded metadata for this value.ClassMetaDataaddEmbeddedMetaData(int access)Add embedded metadata for this value with the given access typeprotected voidaddExtensionKeys(java.util.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.voidbackingMember(java.lang.reflect.Member member)Supply the backing member object; this allows us to utilize parameterized type information if available.intcompareTo(java.lang.Object other)voidcopy(FieldMetaData field)Copy state from the given field to this one.voidcopy(ValueMetaData vmd)Copy state from the given value to this one.booleanequals(java.lang.Object other)intgetAccessType()Gets the access type used by this field.intgetAssociationType()java.lang.reflect.MembergetBackingMember()Return the backing member supplied inbackingMember(java.lang.reflect.Member).intgetCascadeAttach()Cascade behavior for attach operation.intgetCascadeDelete()Cascade behavior for delete operation.intgetCascadeDetach()Cascade behavior for detach operation.intgetCascadePersist()Cascade behavior for persist operation.intgetCascadeRefresh()Cascade behavior for refresh operation.java.lang.String[]getComments()Return comments, or empty array if none.java.lang.ClassgetConverter()java.lang.String[]getCustomFetchGroups()Gets the name of the custom fetch groups those are associated to this receiver.intgetDeclaredIndex()The relative index of this persistent/transactional field.java.lang.ClassgetDeclaredType()Return the declared class of the value.intgetDeclaredTypeCode()Return the declared type code of the value.ClassMetaDatagetDeclaredTypeMetaData()Return metadata for the value's class, if the type is persistent.ClassMetaDatagetDeclaringMetaData()The declaring class.java.lang.Class<?>getDeclaringType()The declaring class.ClassMetaDatagetDefiningMetaData()The class that defines the metadata for this field.ValueMetaDatagetElement()Metadata about the element value.ClassMetaDatagetEmbeddedMetaData()The embedded class metadata for the value.java.lang.StringgetExternalizer()The name of this field's externalizer, or null if none.java.lang.reflect.MethodgetExternalizerMethod()The externalizer method.java.lang.ObjectgetExternalValue(java.lang.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.java.util.MapgetExternalValueMap()Return the mapping of field values to external values.java.lang.StringgetExternalValues()Properties string mapping field values to external values.java.lang.StringgetFactory()The name of this field's factory, or null if none.java.lang.reflect.MembergetFactoryMethod()The factory method or constructor.FieldMetaDatagetFieldMetaData()Return the owning field for this value.java.lang.ObjectgetFieldValue(java.lang.Object val, StoreContext ctx)Return the result of passing the given external value through the factory to get the field value.java.util.MapgetFieldValueMap()Return the mapping of external values to field values.java.lang.StringgetFullName()Deprecated.Use getFullName(boolean) instead.java.lang.StringgetFullName(boolean embedOwner)The field name, qualified by the owning class and optionally the embedding owner's name (if any).intgetIndex()The absolute index of this persistent/transactional field.java.lang.ObjectgetInitializer()The initializer used by the field, or null if none.java.lang.StringgetInverse()Logical inverse field.FieldMetaData[]getInverseMetaDatas()Return all inverses of this field.ValueMetaDatagetKey()Metadata about the key value.intgetListingIndex()The index in which this field was listed in the metadata.java.lang.StringgetLoadFetchGroup()The fetch group that is to be loaded when this receiver is loaded, or null if none set.intgetManagement()Return the management level for the field.java.lang.StringgetMappedBy()The field that this field shares a mapping with.FieldMetaDatagetMappedByField(ClassMetaData meta, java.lang.String mappedBy)java.lang.StringgetMappedByIdValue()FieldMetaDatagetMappedByMetaData()The field that this field shares a mapping with.java.lang.StringgetName()The field name.intgetNullValue()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.java.lang.Class<?>getObjectIdFieldType()For a primary key field, return the type of the corresponding object id class field.intgetObjectIdFieldTypeCode()For a primary key field, return the type of the corresponding object id class field.java.lang.StringgetOrderDeclaration()String declaring the orderings for this field to be applied on load, or null.Order[]getOrders()The orderings for this field to be applied on load, or empty array.intgetPrimaryKeyIndex()The absolute primary key index for this field, or -1 if not a primary key.java.lang.Class<?>getProxyType()The type this field was initialized with, and therefore the type to use for proxies when loading data into this field.java.lang.StringgetRealName()The field name, qualified by the defining class.java.lang.Class<?>getRelationType()MetaDataRepositorygetRepository()The metadata repository.intgetResolve()Resolve mode for this field.java.lang.StringgetSetterName()java.lang.ClassgetType()The value class.intgetTypeCode()The type code of the value class.ClassMetaDatagetTypeMetaData()The metadata for the value class, if the type is persistent.java.lang.Class<?>getTypeOverride()User-supplied type overriding assumed type based on field.intgetUpdateStrategy()The strategy to use when updating the field.booleangetUseSchemaElement()Whether to include schema name in generated filesValueMetaDatagetValue()MetaData about the field value.java.lang.StringgetValueMappedBy()The field that this value shares a mapping with.FieldMetaDatagetValueMappedByMetaData()The field that this value shares a mapping with.SequenceMetaDatagetValueSequenceMetaData()Metadata for the value sequence.java.lang.StringgetValueSequenceName()The value sequence name, or null for none.intgetValueStrategy()The strategy to use for insert value generation.inthashCode()booleanisDeclaredTypePC()Whether the type is a persistence capable instance.booleanisDefaultFetchGroupExplicit()Whether the default fetch group setting is explicit.booleanisDelayCapable()booleanisElementCollection()booleanisEmbedded()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.booleanisEmbeddedPC()Whether this is an embedded persistence capable value.booleanisExplicit()Whether this field is explicitly declared in the metadata.booleanisExternalized()Whether the field is externalized.booleanisInDefaultFetchGroup()Whether this field is in the default fetch group.booleanisInFetchGroup(java.lang.String fg)Whether this field is in the given fetch group.booleanisLRS()Whether this field is backed by a large result set.booleanisMapped()Return whether this field is mapped to the datastore.booleanisMappedById()booleanisPersistentCollection()booleanisPrimaryKey()Whether this is a primary key field.booleanisSerialized()Whether this value is serialized when stored.booleanisStream()Whether this field is backed by a stream.booleanisTransient()Return whether this is a transient field.booleanisTypePC()Whether the type is a persistence capable instance.booleanisUsedInOrderBy()Check if this field is used by other field as "order by" value.booleanisValueGenerated()booleanisVersion()Whether this field holds optimistic version information.java.lang.Objectorder(java.lang.Object val)Order this field value when it is loaded.booleanresolve(int mode)Resolve and validate metadata.voidsetAccessType(int fCode)Sets access type of this field.voidsetAssociationType(int type)voidsetCascadeAttach(int attach)Cascade behavior for attach operation.voidsetCascadeDelete(int delete)Cascade behavior for deletion.voidsetCascadeDetach(int detach)Cascade behavior for detach operation.voidsetCascadePersist(int persist)Cascade behavior for persist operation.voidsetCascadePersist(int cascade, boolean checkPUDefault)Cascade behavior for persist operation.voidsetCascadeRefresh(int refresh)Cascade behavior for refresh operation.voidsetComments(java.lang.String[] comments)Set comments.voidsetConverter(java.lang.Class converter)voidsetDeclaredIndex(int index)The relative index of this persistent/transactional field.voidsetDeclaredType(java.lang.Class type)Set the declared class of the value.voidsetDeclaredTypeCode(int type)Set the type code for the value.voidsetDeclaringType(java.lang.Class<?> cls)The declaring class.voidsetDefaultFetchGroupExplicit(boolean explicit)Whether the default fetch group setting is explicit.voidsetDelayCapable(java.lang.Boolean delayCapable)voidsetElementCollection(boolean isElementCollection)voidsetEmbedded(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.voidsetExplicit(boolean explicit)Whether this field is explicitly declared in the metadata.voidsetExternalizer(java.lang.String externalizer)The name of this field's externalizer, or null if none.voidsetExternalValues(java.lang.String values)Properties string mapping field values to external values.voidsetFactory(java.lang.String factory)The name of this field's factory, or null if none.voidsetInDefaultFetchGroup(boolean dfg)Whether this field is in the default fetch group.voidsetIndex(int index)The absolute index of this persistent/transactional field.voidsetInFetchGroup(java.lang.String fg, boolean in)Set whether this field is in the given fetch group.voidsetInitializer(java.lang.Object initializer)The initializer used by the field, or null if none.voidsetInverse(java.lang.String inverse)Logical inverse field.voidsetListingIndex(int index)The index in which this field was listed in the metadata.voidsetLoadFetchGroup(java.lang.String lfg)The fetch group that is to be loaded when this receiver is loaded, or null if none set.voidsetLRS(boolean lrs)Whether this field is backed by a large result set.voidsetManagement(int manage)Return the management level for the field.voidsetMappedBy(java.lang.String mapped)The field that this field shares a mapping with.voidsetMappedByIdValue(java.lang.String mappedByIdValue)voidsetNullValue(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.voidsetOrderDeclaration(java.lang.String dec)String declaring the orderings for this field to be applied on load, or null.voidsetOrders(Order[] orders)The orderings for this field to be applied on load.voidsetPersistentCollection(boolean persistentCollection)voidsetPrimaryKey(boolean primKey)Whether this is a primary key field.voidsetPrimaryKeyIndex(int index)The absolute primary key index for this field, or -1 if not a primary key.voidsetProxyType(java.lang.Class<?> type)The type this field was initialized with, and therefore the type to use for proxies when loading data into this field.voidsetResolve(int mode)Resolve mode for this field.voidsetResolve(int mode, boolean on)Resolve mode for this field.voidsetSerialized(boolean serialized)Whether this value is serialized when stored.voidsetStream(boolean stream)Whether this field is backed by a stream.voidsetTransient(boolean trans)Return whether this is a transient field.voidsetType(java.lang.Class type)The value class.voidsetTypeCode(int code)The type code of the value class.voidsetTypeOverride(java.lang.Class type)User-supplied type overriding assumed type based on field.voidsetUpdateStrategy(int strategy)Set the update strategy.voidsetUsedInOrderBy(boolean isUsed)Whether this field is used by other field as "order by" value .voidsetUseSchemaElement(boolean _useSchemaElement)Whether to include schema name in generated filesvoidsetUsesImplData(java.lang.Boolean implData)Whether this field uses impl data in conjunction with standard field data when acting on aOpenJPAStateManager.voidsetUsesIntermediate(boolean intermediate)Whether this field uses intermediate data when loading/storing information through aOpenJPAStateManager.voidsetValueGenerated(boolean generated)voidsetValueMappedBy(java.lang.String mapped)The field that this value shares a mapping with.voidsetValueSequenceName(java.lang.String seqName)The value sequence name, or null for none.voidsetValueStrategy(int strategy)The strategy to use for insert value generation.voidsetVersion(boolean version)Whether this field holds optimistic version information.java.lang.StringtoString()java.lang.BooleanusesImplData()Whether this field uses impl data in conjunction with standard field data when acting on aOpenJPAStateManager.booleanusesIntermediate()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 Detail
-
NULL_UNSET
public static final int NULL_UNSET
Constant specifying that no null-value was given.- See Also:
- Constant Field Values
-
NULL_NONE
public static final int NULL_NONE
Constant specifying to use a datastore null to persist null values in object fields.- See Also:
- Constant Field Values
-
NULL_DEFAULT
public static final int NULL_DEFAULT
Constant specifying to use a datastore default value to persist null values in object fields.- See Also:
- Constant Field Values
-
NULL_EXCEPTION
public static final int NULL_EXCEPTION
Constant specifying to throw an exception when attempting to persist null values in object fields.- See Also:
- Constant Field Values
-
MANAGE_PERSISTENT
public static final int MANAGE_PERSISTENT
Constant specifying the management level of a field.- See Also:
- Constant Field Values
-
MANAGE_TRANSACTIONAL
public static final int MANAGE_TRANSACTIONAL
Constant specifying the management level of a field.- See Also:
- Constant Field Values
-
MANAGE_NONE
public static final int MANAGE_NONE
Constant specifying the management level of a field.- See Also:
- Constant Field Values
-
ONE_TO_ONE
public static final int ONE_TO_ONE
- See Also:
- Constant Field Values
-
ONE_TO_MANY
public static final int ONE_TO_MANY
- See Also:
- Constant Field Values
-
MANY_TO_ONE
public static final int MANY_TO_ONE
- See Also:
- Constant Field Values
-
MANY_TO_MANY
public static final int MANY_TO_MANY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FieldMetaData
protected FieldMetaData(java.lang.String name, java.lang.Class<?> type, ClassMetaData owner)Constructor.- Parameters:
name- the field nametype- the field typeowner- the owning class metadata
-
-
Method Detail
-
backingMember
public void backingMember(java.lang.reflect.Member member)
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
public java.lang.reflect.Member getBackingMember()
Return the backing member supplied inbackingMember(java.lang.reflect.Member).
-
getRepository
public MetaDataRepository getRepository()
The metadata repository.- Specified by:
getRepositoryin interfaceMetaDataContext- Specified by:
getRepositoryin classExtensions
-
getDefiningMetaData
public ClassMetaData getDefiningMetaData()
The class that defines the metadata for this field.
-
getDeclaringType
public java.lang.Class<?> getDeclaringType()
The declaring class.
-
setDeclaringType
public void setDeclaringType(java.lang.Class<?> cls)
The declaring class.
-
getDeclaringMetaData
public ClassMetaData getDeclaringMetaData()
The declaring class.
-
getName
public java.lang.String getName()
The field name.
-
getFullName
@Deprecated public java.lang.String getFullName()
Deprecated.Use getFullName(boolean) instead.The field name, qualified by the owning class.
-
getFullName
public java.lang.String getFullName(boolean embedOwner)
The field name, qualified by the owning class and optionally the embedding owner's name (if any).
-
getRealName
public java.lang.String getRealName()
The field name, qualified by the defining class.
-
getValue
public ValueMetaData getValue()
MetaData about the field value.
-
getKey
public ValueMetaData getKey()
Metadata about the key value.
-
getElement
public ValueMetaData 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
public java.lang.Class<?> getProxyType()
The type this field was initialized with, and therefore the type to use for proxies when loading data into this field.
-
setProxyType
public void setProxyType(java.lang.Class<?> type)
The type this field was initialized with, and therefore the type to use for proxies when loading data into this field.
-
getInitializer
public java.lang.Object getInitializer()
The initializer used by the field, or null if none. This is additional information for initializing the field, such as a customComparatorused by aSetor aTimeZoneused by aCalendar.
-
setInitializer
public void setInitializer(java.lang.Object initializer)
The initializer used by the field, or null if none. This is additional information for initializing the field, such as a customComparatorused by aSetor aTimeZoneused 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-1if 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-1if 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
public java.lang.Class<?> 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
public java.lang.String[] 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
public java.lang.String getLoadFetchGroup()
The fetch group that is to be loaded when this receiver is loaded, or null if none set.
-
setLoadFetchGroup
public void setLoadFetchGroup(java.lang.String lfg)
The fetch group that is to be loaded when this receiver is loaded, or null if none set.
-
isInFetchGroup
public boolean isInFetchGroup(java.lang.String fg)
Whether this field is in the given fetch group.
-
setInFetchGroup
public void setInFetchGroup(java.lang.String fg, boolean in)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
public java.lang.String getMappedBy()
The field that this field shares a mapping with.
-
setMappedBy
public void setMappedBy(java.lang.String mapped)
The field that this field shares a mapping with.
-
getMappedByMetaData
public FieldMetaData getMappedByMetaData()
The field that this field shares a mapping with.
-
getMappedByField
public FieldMetaData getMappedByField(ClassMetaData meta, java.lang.String mappedBy)
-
getInverse
public java.lang.String getInverse()
Logical inverse field.
-
setInverse
public void setInverse(java.lang.String inverse)
Logical inverse field.
-
getInverseMetaDatas
public FieldMetaData[] 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
public java.lang.String getValueSequenceName()
The value sequence name, or null for none.
-
setValueSequenceName
public void setValueSequenceName(java.lang.String seqName)
The value sequence name, or null for none.
-
getValueSequenceMetaData
public SequenceMetaData 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
public java.lang.Boolean 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.FALSEif this field does not use impl data,Boolean.TRUEif this field uses non-cachable impl data, ornullif this field uses impl data that should be cached across instances- See Also:
OpenJPAStateManager.setImplData(int,Object)
-
setUsesImplData
public void setUsesImplData(java.lang.Boolean implData)
Whether this field uses impl data in conjunction with standard field data when acting on aOpenJPAStateManager.
-
getOrders
public Order[] getOrders()
The orderings for this field to be applied on load, or empty array.
-
setOrders
public void setOrders(Order[] orders)
The orderings for this field to be applied on load.
-
getOrderDeclaration
public java.lang.String 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#elementis used to denote the value of the field's elements.
-
setOrderDeclaration
public void setOrderDeclaration(java.lang.String dec)
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#elementis used to denote the value of the field's elements.
-
order
public java.lang.Object order(java.lang.Object val)
Order this field value when it is loaded.
-
isExternalized
public boolean isExternalized()
Whether the field is externalized.
-
getExternalValue
public java.lang.Object getExternalValue(java.lang.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.
-
getFieldValue
public java.lang.Object getFieldValue(java.lang.Object val, StoreContext ctx)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
public java.lang.String getExternalizer()
The name of this field's externalizer, or null if none.
-
setExternalizer
public void setExternalizer(java.lang.String externalizer)
The name of this field's externalizer, or null if none.
-
setConverter
public void setConverter(java.lang.Class converter)
-
getFactory
public java.lang.String getFactory()
The name of this field's factory, or null if none.
-
setFactory
public void setFactory(java.lang.String factory)
The name of this field's factory, or null if none.
-
getExternalValues
public java.lang.String getExternalValues()
Properties string mapping field values to external values.
-
setExternalValues
public void setExternalValues(java.lang.String values)
Properties string mapping field values to external values.
-
getExternalValueMap
public java.util.Map getExternalValueMap()
Return the mapping of field values to external values.
-
getFieldValueMap
public java.util.Map getFieldValueMap()
Return the mapping of external values to field values.
-
getExternalizerMethod
public java.lang.reflect.Method getExternalizerMethod()
The externalizer method.
-
getFactoryMethod
public java.lang.reflect.Member getFactoryMethod()
The factory method or constructor.
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
compareTo
public int compareTo(java.lang.Object other)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getResolve
public int getResolve()
Resolve mode for this field.- Specified by:
getResolvein interfaceValueMetaData
-
setResolve
public void setResolve(int mode)
Resolve mode for this field.- Specified by:
setResolvein interfaceValueMetaData
-
setResolve
public void setResolve(int mode, boolean on)Resolve mode for this field.- Specified by:
setResolvein interfaceValueMetaData
-
resolve
public boolean resolve(int mode)
Resolve and validate metadata. Return true if already resolved.- Specified by:
resolvein interfaceValueMetaData
-
copy
public void copy(FieldMetaData field)
Copy state from the given field to this one. Do not copy mapping information.
-
addExtensionKeys
protected void addExtensionKeys(java.util.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
-
getComments
public java.lang.String[] getComments()
Description copied from interface:CommentableReturn comments, or empty array if none.- Specified by:
getCommentsin interfaceCommentable
-
setComments
public void setComments(java.lang.String[] comments)
Description copied from interface:CommentableSet comments.- Specified by:
setCommentsin interfaceCommentable
-
getFieldMetaData
public FieldMetaData getFieldMetaData()
Description copied from interface:ValueMetaDataReturn the owning field for this value.- Specified by:
getFieldMetaDatain interfaceValueMetaData
-
getType
public java.lang.Class getType()
Description copied from interface:ValueMetaDataThe value class.- Specified by:
getTypein interfaceValueMetaData
-
setType
public void setType(java.lang.Class type)
Description copied from interface:ValueMetaDataThe value class.- Specified by:
setTypein interfaceValueMetaData
-
getTypeCode
public int getTypeCode()
Description copied from interface:ValueMetaDataThe type code of the value class.- Specified by:
getTypeCodein interfaceValueMetaData
-
setTypeCode
public void setTypeCode(int code)
Description copied from interface:ValueMetaDataThe type code of the value class.- Specified by:
setTypeCodein interfaceValueMetaData
-
isTypePC
public boolean isTypePC()
Description copied from interface:ValueMetaDataWhether the type is a persistence capable instance.- Specified by:
isTypePCin interfaceValueMetaData
-
getTypeMetaData
public ClassMetaData getTypeMetaData()
Description copied from interface:ValueMetaDataThe metadata for the value class, if the type is persistent.- Specified by:
getTypeMetaDatain interfaceValueMetaData
-
getDeclaredType
public java.lang.Class getDeclaredType()
Description copied from interface:ValueMetaDataReturn 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:
getDeclaredTypein interfaceValueMetaData
-
setDeclaredType
public void setDeclaredType(java.lang.Class type)
Description copied from interface:ValueMetaDataSet the declared class of the value.- Specified by:
setDeclaredTypein interfaceValueMetaData
-
getDeclaredTypeCode
public int getDeclaredTypeCode()
Description copied from interface:ValueMetaDataReturn 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:
getDeclaredTypeCodein interfaceValueMetaData
-
setDeclaredTypeCode
public void setDeclaredTypeCode(int type)
Description copied from interface:ValueMetaDataSet 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:
setDeclaredTypeCodein interfaceValueMetaData
-
isDeclaredTypePC
public boolean isDeclaredTypePC()
Description copied from interface:ValueMetaDataWhether the type is a persistence capable instance.- Specified by:
isDeclaredTypePCin interfaceValueMetaData
-
getDeclaredTypeMetaData
public ClassMetaData getDeclaredTypeMetaData()
Description copied from interface:ValueMetaDataReturn metadata for the value's class, if the type is persistent.- Specified by:
getDeclaredTypeMetaDatain interfaceValueMetaData
-
isEmbedded
public boolean isEmbedded()
Description copied from interface:ValueMetaDataThis 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:
isEmbeddedin interfaceValueMetaData
-
setEmbedded
public void setEmbedded(boolean embedded)
Description copied from interface:ValueMetaDataThis 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:
setEmbeddedin interfaceValueMetaData
-
isEmbeddedPC
public boolean isEmbeddedPC()
Description copied from interface:ValueMetaDataWhether this is an embedded persistence capable value.- Specified by:
isEmbeddedPCin interfaceValueMetaData
-
getEmbeddedMetaData
public ClassMetaData getEmbeddedMetaData()
Description copied from interface:ValueMetaDataThe embedded class metadata for the value.- Specified by:
getEmbeddedMetaDatain interfaceValueMetaData
-
addEmbeddedMetaData
public ClassMetaData addEmbeddedMetaData(int access)
Description copied from interface:ValueMetaDataAdd embedded metadata for this value with the given access type- Specified by:
addEmbeddedMetaDatain interfaceValueMetaData
-
addEmbeddedMetaData
public ClassMetaData addEmbeddedMetaData()
Description copied from interface:ValueMetaDataAdd embedded metadata for this value.- Specified by:
addEmbeddedMetaDatain interfaceValueMetaData
-
getCascadeDelete
public int getCascadeDelete()
Description copied from interface:ValueMetaDataCascade 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:
getCascadeDeletein interfaceValueMetaData
-
setCascadeDelete
public void setCascadeDelete(int delete)
Description copied from interface:ValueMetaDataCascade behavior for deletion.- Specified by:
setCascadeDeletein interfaceValueMetaData- See Also:
ValueMetaData.getCascadeDelete()
-
getCascadePersist
public int getCascadePersist()
Description copied from interface:ValueMetaDataCascade 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:
getCascadePersistin interfaceValueMetaData
-
setCascadePersist
public void setCascadePersist(int persist)
Description copied from interface:ValueMetaDataCascade behavior for persist operation.- Specified by:
setCascadePersistin interfaceValueMetaData- See Also:
ValueMetaData.getCascadePersist()
-
setCascadePersist
public void setCascadePersist(int cascade, boolean checkPUDefault)Description copied from interface:ValueMetaDataCascade behavior for persist operation.- Specified by:
setCascadePersistin interfaceValueMetaData- See Also:
ValueMetaData.getCascadePersist()
-
getCascadeAttach
public int getCascadeAttach()
Description copied from interface:ValueMetaDataCascade 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:
getCascadeAttachin interfaceValueMetaData
-
setCascadeAttach
public void setCascadeAttach(int attach)
Description copied from interface:ValueMetaDataCascade behavior for attach operation.- Specified by:
setCascadeAttachin interfaceValueMetaData- See Also:
ValueMetaData.getCascadeAttach()
-
getCascadeDetach
public int getCascadeDetach()
Description copied from interface:ValueMetaDataCascade 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:
getCascadeDetachin interfaceValueMetaData
-
setCascadeDetach
public void setCascadeDetach(int detach)
Description copied from interface:ValueMetaDataCascade behavior for detach operation.- Specified by:
setCascadeDetachin interfaceValueMetaData- See Also:
ValueMetaData.getCascadeDetach()
-
getCascadeRefresh
public int getCascadeRefresh()
Description copied from interface:ValueMetaDataCascade 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:
getCascadeRefreshin interfaceValueMetaData
-
setCascadeRefresh
public void setCascadeRefresh(int refresh)
Description copied from interface:ValueMetaDataCascade behavior for refresh operation.- Specified by:
setCascadeRefreshin interfaceValueMetaData- See Also:
ValueMetaData.getCascadeRefresh()
-
isSerialized
public boolean isSerialized()
Description copied from interface:ValueMetaDataWhether this value is serialized when stored.- Specified by:
isSerializedin interfaceValueMetaData
-
setSerialized
public void setSerialized(boolean serialized)
Description copied from interface:ValueMetaDataWhether this value is serialized when stored.- Specified by:
setSerializedin interfaceValueMetaData
-
getValueMappedBy
public java.lang.String getValueMappedBy()
Description copied from interface:ValueMetaDataThe 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:
getValueMappedByin interfaceValueMetaData
-
setValueMappedBy
public void setValueMappedBy(java.lang.String mapped)
Description copied from interface:ValueMetaDataThe 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:
setValueMappedByin interfaceValueMetaData
-
getValueMappedByMetaData
public FieldMetaData getValueMappedByMetaData()
Description copied from interface:ValueMetaDataThe 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:
getValueMappedByMetaDatain interfaceValueMetaData
-
getTypeOverride
public java.lang.Class<?> getTypeOverride()
Description copied from interface:ValueMetaDataUser-supplied type overriding assumed type based on field.- Specified by:
getTypeOverridein interfaceValueMetaData
-
setTypeOverride
public void setTypeOverride(java.lang.Class type)
Description copied from interface:ValueMetaDataUser-supplied type overriding assumed type based on field.- Specified by:
setTypeOverridein interfaceValueMetaData
-
copy
public void copy(ValueMetaData vmd)
Description copied from interface:ValueMetaDataCopy state from the given value to this one. Do not copy mapping information.- Specified by:
copyin 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
public java.lang.String getMappedByIdValue()
-
setMappedByIdValue
public void setMappedByIdValue(java.lang.String mappedByIdValue)
-
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
public java.lang.Class<?> getRelationType()
-
isDelayCapable
public boolean isDelayCapable()
-
setDelayCapable
public void setDelayCapable(java.lang.Boolean delayCapable)
-
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
public java.lang.String getSetterName()
-
getConverter
public java.lang.Class getConverter()
-
-