org.apache.openjpa.meta
Class ValueMetaDataImpl

java.lang.Object
  extended by org.apache.openjpa.meta.ValueMetaDataImpl
All Implemented Interfaces:
Serializable, MetaDataContext, MetaDataModes, ValueMetaData
Direct Known Subclasses:
ValueMappingImpl

public class ValueMetaDataImpl
extends Object
implements ValueMetaData

Default ValueMetaData implementation.

Author:
Abe White
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.apache.openjpa.meta.ValueMetaData
CASCADE_AUTO, CASCADE_IMMEDIATE, CASCADE_NONE, MAPPED_BY_PK
 
Fields inherited from interface org.apache.openjpa.meta.MetaDataModes
MODE_ANN_MAPPING, MODE_MAPPING, MODE_MAPPING_INIT, MODE_META, MODE_NONE, MODE_QUERY
 
Constructor Summary
protected ValueMetaDataImpl()
          Constructor for serialization.
protected ValueMetaDataImpl(FieldMetaData owner)
           
 
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.
 MetaDataRepository getRepository()
          Access metadata repository.
 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 attach)
          Cascade behavior for attach operation.
 void setCascadeDelete(int delete)
          Cascade behavior for deletion.
 void setCascadePersist(int persist)
          Cascade behavior for persist operation.
 void setCascadeRefresh(int refresh)
          Cascade behavior for refresh operation.
 void setDeclaredType(Class type)
          Set the declared class of the value.
 void setDeclaredTypeCode(int code)
          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 val)
          User-supplied type overriding assumed type based on field.
 void setValueMappedBy(String mapped)
          The field that this value shares a mapping with.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ValueMetaDataImpl

protected ValueMetaDataImpl(FieldMetaData owner)

ValueMetaDataImpl

protected ValueMetaDataImpl()
Constructor for serialization.

Method Detail

getFieldMetaData

public FieldMetaData getFieldMetaData()
Description copied from interface: ValueMetaData
Return the owning field for this value.

Specified by:
getFieldMetaData in interface ValueMetaData

getRepository

public MetaDataRepository getRepository()
Description copied from interface: MetaDataContext
Access metadata repository.

Specified by:
getRepository in interface MetaDataContext

getType

public Class getType()
Description copied from interface: ValueMetaData
The value class.

Specified by:
getType in interface ValueMetaData

setType

public void setType(Class type)
Description copied from interface: ValueMetaData
The value class.

Specified by:
setType in interface ValueMetaData

getTypeCode

public int getTypeCode()
Description copied from interface: ValueMetaData
The type code of the value class.

Specified by:
getTypeCode in interface ValueMetaData

setTypeCode

public void setTypeCode(int code)
Description copied from interface: ValueMetaData
The type code of the value class.

Specified by:
setTypeCode in interface ValueMetaData

isTypePC

public boolean isTypePC()
Description copied from interface: ValueMetaData
Whether the type is a persistence capable instance.

Specified by:
isTypePC in interface ValueMetaData

getTypeMetaData

public ClassMetaData getTypeMetaData()
Description copied from interface: ValueMetaData
The metadata for the value class, if the type is persistent.

Specified by:
getTypeMetaData in interface ValueMetaData

getDeclaredType

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

Specified by:
getDeclaredType in interface ValueMetaData

setDeclaredType

public void setDeclaredType(Class type)
Description copied from interface: ValueMetaData
Set the declared class of the value.

Specified by:
setDeclaredType in interface ValueMetaData

getDeclaredTypeCode

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

Specified by:
getDeclaredTypeCode in interface ValueMetaData

setDeclaredTypeCode

public void setDeclaredTypeCode(int code)
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 interface ValueMetaData

isDeclaredTypePC

public boolean isDeclaredTypePC()
Description copied from interface: ValueMetaData
Whether the type is a persistence capable instance.

Specified by:
isDeclaredTypePC in interface ValueMetaData

getDeclaredTypeMetaData

public ClassMetaData getDeclaredTypeMetaData()
Description copied from interface: ValueMetaData
Return metadata for the value's class, if the type is persistent.

Specified by:
getDeclaredTypeMetaData in interface ValueMetaData

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 interface ValueMetaData

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 interface ValueMetaData

isEmbeddedPC

public boolean isEmbeddedPC()
Description copied from interface: ValueMetaData
Whether this is an embedded persistence capable value.

Specified by:
isEmbeddedPC in interface ValueMetaData

getEmbeddedMetaData

public ClassMetaData getEmbeddedMetaData()
Description copied from interface: ValueMetaData
The embedded class metadata for the value.

Specified by:
getEmbeddedMetaData in interface ValueMetaData

addEmbeddedMetaData

public ClassMetaData addEmbeddedMetaData()
Description copied from interface: ValueMetaData
Add embedded metadata for this value.

Specified by:
addEmbeddedMetaData in interface ValueMetaData

getCascadeDelete

public int getCascadeDelete()
Description copied from interface: ValueMetaData
Cascade behavior for delete operation. Only applies to persistence-capable values. Options are:

Specified by:
getCascadeDelete in interface ValueMetaData

setCascadeDelete

public void setCascadeDelete(int delete)
Description copied from interface: ValueMetaData
Cascade behavior for deletion.

Specified by:
setCascadeDelete in interface ValueMetaData
See Also:
ValueMetaData.getCascadeDelete()

getCascadePersist

public int getCascadePersist()
Description copied from interface: ValueMetaData
Cascade behavior for persist operation. Only applies to persistence-capable values. Options are:

Specified by:
getCascadePersist in interface ValueMetaData

setCascadePersist

public void setCascadePersist(int persist)
Description copied from interface: ValueMetaData
Cascade behavior for persist operation.

Specified by:
setCascadePersist in interface ValueMetaData
See Also:
ValueMetaData.getCascadePersist()

getCascadeAttach

public int getCascadeAttach()
Description copied from interface: ValueMetaData
Cascade behavior for attach operation. Only applies to persistence-capable values. Options are:

Specified by:
getCascadeAttach in interface ValueMetaData

setCascadeAttach

public void setCascadeAttach(int attach)
Description copied from interface: ValueMetaData
Cascade behavior for attach operation.

Specified by:
setCascadeAttach in interface ValueMetaData
See Also:
ValueMetaData.getCascadeAttach()

getCascadeRefresh

public int getCascadeRefresh()
Description copied from interface: ValueMetaData
Cascade behavior for refresh operation. Only applies to persistence-capable values. Options are:

Specified by:
getCascadeRefresh in interface ValueMetaData

setCascadeRefresh

public void setCascadeRefresh(int refresh)
Description copied from interface: ValueMetaData
Cascade behavior for refresh operation.

Specified by:
setCascadeRefresh in interface ValueMetaData
See Also:
ValueMetaData.getCascadeRefresh()

isSerialized

public boolean isSerialized()
Description copied from interface: ValueMetaData
Whether this value is serialized when stored.

Specified by:
isSerialized in interface ValueMetaData

setSerialized

public void setSerialized(boolean serialized)
Description copied from interface: ValueMetaData
Whether this value is serialized when stored.

Specified by:
setSerialized in interface ValueMetaData

getValueMappedBy

public String 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 interface ValueMetaData

setValueMappedBy

public void setValueMappedBy(String mapped)
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 interface ValueMetaData

getValueMappedByMetaData

public FieldMetaData 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 interface ValueMetaData

getTypeOverride

public Class getTypeOverride()
Description copied from interface: ValueMetaData
User-supplied type overriding assumed type based on field.

Specified by:
getTypeOverride in interface ValueMetaData

setTypeOverride

public void setTypeOverride(Class val)
Description copied from interface: ValueMetaData
User-supplied type overriding assumed type based on field.

Specified by:
setTypeOverride in interface ValueMetaData

toString

public String toString()
Overrides:
toString in class Object

getResolve

public int getResolve()
Description copied from interface: ValueMetaData
Resolve mode for metadata.

Specified by:
getResolve in interface ValueMetaData

setResolve

public void setResolve(int mode)
Description copied from interface: ValueMetaData
Resolve mode for metadata.

Specified by:
setResolve in interface ValueMetaData

setResolve

public void setResolve(int mode,
                       boolean on)
Description copied from interface: ValueMetaData
Resolve mode for metadata.

Specified by:
setResolve in interface ValueMetaData

resolve

public boolean resolve(int mode)
Description copied from interface: ValueMetaData
Resolve and validate metadata. Return true if already resolved.

Specified by:
resolve in interface ValueMetaData

copy

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

Specified by:
copy in interface ValueMetaData


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