org.apache.openjpa.meta
Interface ValueMetaData

All Superinterfaces:
MetaDataContext, MetaDataModes, Serializable
All Known Subinterfaces:
ValueMapping
All Known Implementing Classes:
FieldMapping, FieldMetaData, ValueMappingImpl, ValueMetaDataImpl

public interface ValueMetaData
extends MetaDataContext, MetaDataModes, Serializable

Holds metadata on a value; this could be a field value, key value, or element value.

Since:
0.4.0
Author:
Abe White

Field Summary
static int CASCADE_AUTO
          Use automatic cascade behavior.
static int CASCADE_IMMEDIATE
          The operation is immediately cascaded to this field.
static int CASCADE_NONE
          The operation is not cascaded to this field.
static String MAPPED_BY_PK
          Marker to set on setValueMappedBy(java.lang.String) to denote that the map key is mapped by the primary key field of the value.
 
Fields inherited from interface org.apache.openjpa.meta.MetaDataModes
MODE_ANN_MAPPING, MODE_MAPPING, MODE_MAPPING_INIT, MODE_META, MODE_NONE, MODE_QUERY
 
Method Summary
 ClassMetaData addEmbeddedMetaData()
          Add embedded metadata for this value.
 void copy(ValueMetaData vmd)
          Copy state from the given value to this one.
 int getCascadeAttach()
          Cascade behavior for attach operation.
 int getCascadeDelete()
          Cascade behavior for delete operation.
 int getCascadePersist()
          Cascade behavior for persist operation.
 int getCascadeRefresh()
          Cascade behavior for refresh operation.
 Class getDeclaredType()
          Return the declared class of the value.
 int getDeclaredTypeCode()
          Return the declared type code of the value.
 ClassMetaData getDeclaredTypeMetaData()
          Return metadata for the value's class, if the type is persistent.
 ClassMetaData getEmbeddedMetaData()
          The embedded class metadata for the value.
 FieldMetaData getFieldMetaData()
          Return the owning field for this value.
 int getResolve()
          Resolve mode for metadata.
 Class getType()
          The value class.
 int getTypeCode()
          The type code of the value class.
 ClassMetaData getTypeMetaData()
          The metadata for the value class, if the type is persistent.
 Class getTypeOverride()
          User-supplied type overriding assumed type based on field.
 String getValueMappedBy()
          The field that this value shares a mapping with.
 FieldMetaData getValueMappedByMetaData()
          The field that this value shares a mapping with.
 boolean isDeclaredTypePC()
          Whether the type is a persistence capable instance.
 boolean isEmbedded()
          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 isEmbeddedPC()
          Whether this is an embedded persistence capable value.
 boolean isSerialized()
          Whether this value is serialized when stored.
 boolean isTypePC()
          Whether the type is a persistence capable instance.
 boolean resolve(int mode)
          Resolve and validate metadata.
 void setCascadeAttach(int cascade)
          Cascade behavior for attach operation.
 void setCascadeDelete(int cascade)
          Cascade behavior for deletion.
 void setCascadePersist(int cascade)
          Cascade behavior for persist operation.
 void setCascadeRefresh(int cascade)
          Cascade behavior for refresh operation.
 void setDeclaredType(Class type)
          Set the declared class of the value.
 void setDeclaredTypeCode(int type)
          Set the type code for the value.
 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 setResolve(int mode)
          Resolve mode for metadata.
 void setResolve(int mode, boolean on)
          Resolve mode for metadata.
 void setSerialized(boolean serialized)
          Whether this value is serialized when stored.
 void setType(Class type)
          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 setValueMappedBy(String mapped)
          The field that this value shares a mapping with.
 
Methods inherited from interface org.apache.openjpa.meta.MetaDataContext
getRepository
 

Field Detail

CASCADE_NONE

static final int CASCADE_NONE
The operation is not cascaded to this field.

See Also:
Constant Field Values

CASCADE_IMMEDIATE

static final int CASCADE_IMMEDIATE
The operation is immediately cascaded to this field.

See Also:
Constant Field Values

CASCADE_AUTO

static final int CASCADE_AUTO
Use automatic cascade behavior. Persistence-by-reachability, delete-dependent, attach-if-detached, etc.

See Also:
Constant Field Values

MAPPED_BY_PK

static final String MAPPED_BY_PK
Marker to set on setValueMappedBy(java.lang.String) to denote that the map key is mapped by the primary key field of the value.

See Also:
Constant Field Values
Method Detail

getFieldMetaData

FieldMetaData getFieldMetaData()
Return the owning field for this value.


getType

Class getType()
The value class.


setType

void setType(Class type)
The value class.


getTypeCode

int getTypeCode()
The type code of the value class.


setTypeCode

void setTypeCode(int code)
The type code of the value class.


isTypePC

boolean isTypePC()
Whether the type is a persistence capable instance.


getTypeMetaData

ClassMetaData getTypeMetaData()
The metadata for the value class, if the type is persistent.


getDeclaredType

Class getDeclaredType()
Return the declared class of the value. This can differ from the return value of getType() if the user indicates a different type or the value has an externalizer.


setDeclaredType

void setDeclaredType(Class type)
Set the declared class of the value.


getDeclaredTypeCode

int getDeclaredTypeCode()
Return the declared type code of the value. This can differ from the return value of getTypeCode() if the user indicates a different type or the value has an externalizer.


setDeclaredTypeCode

void setDeclaredTypeCode(int type)
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.


isDeclaredTypePC

boolean isDeclaredTypePC()
Whether the type is a persistence capable instance.


getDeclaredTypeMetaData

ClassMetaData getDeclaredTypeMetaData()
Return metadata for the value's class, if the type is persistent.


isEmbedded

boolean isEmbedded()
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.


setEmbedded

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. 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.


isEmbeddedPC

boolean isEmbeddedPC()
Whether this is an embedded persistence capable value.


getEmbeddedMetaData

ClassMetaData getEmbeddedMetaData()
The embedded class metadata for the value.


addEmbeddedMetaData

ClassMetaData addEmbeddedMetaData()
Add embedded metadata for this value.


getCascadeDelete

int getCascadeDelete()
Cascade behavior for delete operation. Only applies to persistence-capable values. Options are:


setCascadeDelete

void setCascadeDelete(int cascade)
Cascade behavior for deletion.

See Also:
getCascadeDelete()

getCascadePersist

int getCascadePersist()
Cascade behavior for persist operation. Only applies to persistence-capable values. Options are:


setCascadePersist

void setCascadePersist(int cascade)
Cascade behavior for persist operation.

See Also:
getCascadePersist()

getCascadeAttach

int getCascadeAttach()
Cascade behavior for attach operation. Only applies to persistence-capable values. Options are:


setCascadeAttach

void setCascadeAttach(int cascade)
Cascade behavior for attach operation.

See Also:
getCascadeAttach()

getCascadeRefresh

int getCascadeRefresh()
Cascade behavior for refresh operation. Only applies to persistence-capable values. Options are:


setCascadeRefresh

void setCascadeRefresh(int cascade)
Cascade behavior for refresh operation.

See Also:
getCascadeRefresh()

isSerialized

boolean isSerialized()
Whether this value is serialized when stored.


setSerialized

void setSerialized(boolean serialized)
Whether this value is serialized when stored.


getValueMappedBy

String getValueMappedBy()
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.


setValueMappedBy

void setValueMappedBy(String mapped)
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.


getValueMappedByMetaData

FieldMetaData getValueMappedByMetaData()
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.


getTypeOverride

Class getTypeOverride()
User-supplied type overriding assumed type based on field.


setTypeOverride

void setTypeOverride(Class type)
User-supplied type overriding assumed type based on field.


getResolve

int getResolve()
Resolve mode for metadata.


setResolve

void setResolve(int mode)
Resolve mode for metadata.


setResolve

void setResolve(int mode,
                boolean on)
Resolve mode for metadata.


resolve

boolean resolve(int mode)
Resolve and validate metadata. Return true if already resolved.


copy

void copy(ValueMetaData vmd)
Copy state from the given value to this one. Do not copy mapping information.



Copyright © 2006-2010 Apache Software Foundation. All Rights Reserved.