Class ValueMetaDataImpl

java.lang.Object
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:
  • Constructor Details

    • ValueMetaDataImpl

      protected ValueMetaDataImpl(FieldMetaData owner)
    • ValueMetaDataImpl

      protected ValueMetaDataImpl()
      Constructor for serialization.
  • Method Details

    • 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(int access)
      Description copied from interface: ValueMetaData
      Add embedded metadata for this value with the given access type
      Specified by:
      addEmbeddedMetaData 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:
      • 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 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:
    • 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 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:
    • setCascadePersist

      public void setCascadePersist(int persist, boolean checkPUDefault)
      Description copied from interface: ValueMetaData
      Cascade behavior for persist operation.
      Specified by:
      setCascadePersist in interface ValueMetaData
      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 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:
    • 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 interface ValueMetaData
    • setCascadeDetach

      public void setCascadeDetach(int detach)
      Description copied from interface: ValueMetaData
      Cascade behavior for detach operation.
      Specified by:
      setCascadeDetach in interface ValueMetaData
      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 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:
    • 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