Package org.apache.openjpa.meta
Class ValueMetaDataImpl
java.lang.Object
org.apache.openjpa.meta.ValueMetaDataImpl
- All Implemented Interfaces:
Serializable,MetaDataContext,MetaDataModes,ValueMetaData
- Direct Known Subclasses:
ValueMappingImpl
Default
ValueMetaData implementation.- Author:
- Abe White
- See Also:
-
Field Summary
Fields inherited from interface org.apache.openjpa.meta.MetaDataModes
MODE_ALL, MODE_ANN_MAPPING, MODE_MAPPING, MODE_MAPPING_INIT, MODE_META, MODE_NONE, MODE_QUERYFields inherited from interface org.apache.openjpa.meta.ValueMetaData
CASCADE_AUTO, CASCADE_IMMEDIATE, CASCADE_NONE, MAPPED_BY_PK -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor for serialization.protectedValueMetaDataImpl(FieldMetaData owner) -
Method Summary
Modifier and TypeMethodDescriptionAdd embedded metadata for this value.addEmbeddedMetaData(int access) Add embedded metadata for this value with the given access typevoidcopy(ValueMetaData vmd) Copy state from the given value to this one.intCascade behavior for attach operation.intCascade behavior for delete operation.intCascade behavior for detach operation.intCascade behavior for persist operation.intCascade behavior for refresh operation.Return the declared class of the value.intReturn the declared type code of the value.Return metadata for the value's class, if the type is persistent.The embedded class metadata for the value.Return the owning field for this value.Access metadata repository.intResolve mode for metadata.getType()The value class.intThe type code of the value class.The metadata for the value class, if the type is persistent.User-supplied type overriding assumed type based on field.The field that this value shares a mapping with.The field that this value shares a mapping with.booleanWhether the type is a persistence capable instance.booleanThis 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.booleanWhether this is an embedded persistence capable value.booleanWhether this value is serialized when stored.booleanisTypePC()Whether the type is a persistence capable instance.booleanresolve(int mode) Resolve and validate metadata.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 persist, boolean checkPUDefault) Cascade behavior for persist operation.voidsetCascadeRefresh(int refresh) Cascade behavior for refresh operation.voidsetDeclaredType(Class type) Set the declared class of the value.voidsetDeclaredTypeCode(int code) Set the type code for the value.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.voidsetResolve(int mode) Resolve mode for metadata.voidsetResolve(int mode, boolean on) Resolve mode for metadata.voidsetSerialized(boolean serialized) Whether this value is serialized when stored.voidThe value class.voidsetTypeCode(int code) The type code of the value class.voidsetTypeOverride(Class val) User-supplied type overriding assumed type based on field.voidsetValueMappedBy(String mapped) The field that this value shares a mapping with.toString()
-
Constructor Details
-
ValueMetaDataImpl
-
ValueMetaDataImpl
protected ValueMetaDataImpl()Constructor for serialization.
-
-
Method Details
-
getFieldMetaData
Description copied from interface:ValueMetaDataReturn the owning field for this value.- Specified by:
getFieldMetaDatain interfaceValueMetaData
-
getRepository
Description copied from interface:MetaDataContextAccess metadata repository.- Specified by:
getRepositoryin interfaceMetaDataContext
-
getType
Description copied from interface:ValueMetaDataThe value class.- Specified by:
getTypein interfaceValueMetaData
-
setType
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
Description copied from interface:ValueMetaDataThe metadata for the value class, if the type is persistent.- Specified by:
getTypeMetaDatain interfaceValueMetaData
-
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
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 code) 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
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
Description copied from interface:ValueMetaDataThe embedded class metadata for the value.- Specified by:
getEmbeddedMetaDatain interfaceValueMetaData
-
addEmbeddedMetaData
Description copied from interface:ValueMetaDataAdd embedded metadata for this value with the given access type- Specified by:
addEmbeddedMetaDatain interfaceValueMetaData
-
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:
-
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:
-
setCascadePersist
public void setCascadePersist(int persist, boolean checkPUDefault) Description copied from interface:ValueMetaDataCascade behavior for persist operation.- Specified by:
setCascadePersistin interfaceValueMetaData- See Also:
-
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:
-
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:
-
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:
-
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
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
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
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
Description copied from interface:ValueMetaDataUser-supplied type overriding assumed type based on field.- Specified by:
getTypeOverridein interfaceValueMetaData
-
setTypeOverride
Description copied from interface:ValueMetaDataUser-supplied type overriding assumed type based on field.- Specified by:
setTypeOverridein interfaceValueMetaData
-
toString
-
getResolve
public int getResolve()Description copied from interface:ValueMetaDataResolve mode for metadata.- Specified by:
getResolvein interfaceValueMetaData
-
setResolve
public void setResolve(int mode) Description copied from interface:ValueMetaDataResolve mode for metadata.- Specified by:
setResolvein interfaceValueMetaData
-
setResolve
public void setResolve(int mode, boolean on) Description copied from interface:ValueMetaDataResolve mode for metadata.- Specified by:
setResolvein interfaceValueMetaData
-
resolve
public boolean resolve(int mode) Description copied from interface:ValueMetaDataResolve and validate metadata. Return true if already resolved.- Specified by:
resolvein interfaceValueMetaData
-
copy
Description copied from interface:ValueMetaDataCopy state from the given value to this one. Do not copy mapping information.- Specified by:
copyin interfaceValueMetaData
-