Class AbstractColumnMapping

All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
AbstractDirectMapping, MultitenantPrimaryKeyMapping

public abstract class AbstractColumnMapping extends DatabaseMapping
Purpose: Maps an attribute or some other property to the corresponding database field type. The list of field types that are supported by EclipseLink's direct to field mapping is dependent on the relational database being used.
Since:
TopLink/Java 1.0
See Also:
  • Field Details

    • field

      protected DatabaseField field
      DatabaseField which this mapping represents.
    • converter

      protected Converter converter
      Allows user defined conversion between the object attribute value and the database value.
    • converterClassName

      protected String converterClassName
    • isInsertable

      protected boolean isInsertable
      Flag to support insertable JPA setting
    • isUpdatable

      protected boolean isUpdatable
      Flag to support updatable JPA setting
  • Constructor Details

    • AbstractColumnMapping

      protected AbstractColumnMapping()
      Default constructor.
  • Method Details

    • cascadePerformRemoveIfRequired

      public void cascadePerformRemoveIfRequired(Object object, UnitOfWorkImpl uow, Map visitedObjects)
      INTERNAL: Cascade perform delete through mappings that require the cascade.
      Specified by:
      cascadePerformRemoveIfRequired in class DatabaseMapping
      Parameters:
      object - TODO
      uow - TODO
      visitedObjects - TODO
    • cascadeRegisterNewIfRequired

      public void cascadeRegisterNewIfRequired(Object object, UnitOfWorkImpl uow, Map visitedObjects)
      INTERNAL: Cascade registerNew for Create through mappings that require the cascade.
      Specified by:
      cascadeRegisterNewIfRequired in class DatabaseMapping
      Parameters:
      object - TODO
      uow - TODO
      visitedObjects - TODO
    • clone

      public Object clone()
      INTERNAL: The mapping clones itself to create deep copy.
      Overrides:
      clone in class DatabaseMapping
      Returns:
      new instance of itself
    • collectFields

      protected Vector<DatabaseField> collectFields()
      Returns the field this mapping represents.
      Overrides:
      collectFields in class DatabaseMapping
      Returns:
      TODO
    • convertClassNamesToClasses

      public void convertClassNamesToClasses(ClassLoader classLoader)
      INTERNAL: Convert all the class-name-based settings in this mapping to actual class-based settings This method is implemented by subclasses as necessary.
      Overrides:
      convertClassNamesToClasses in class DatabaseMapping
      Parameters:
      classLoader - TODO
    • fixObjectReferences

      public void fixObjectReferences(Object object, Map<Object,ObjectDescriptor> objectDescriptors, Map<Object,Object> processedObjects, ObjectLevelReadQuery query, DistributedSession session)
      INTERNAL: An object has been serialized from the server to the client. Replace the transient attributes of the remote value holders with client-side objects.
      Specified by:
      fixObjectReferences in class DatabaseMapping
      Parameters:
      object - TODO
      objectDescriptors - TODO
      processedObjects - TODO
      query - TODO
      session - TODO
    • getConverter

      public Converter getConverter()
      PUBLIC: Return the converter on the mapping. A converter can be used to convert between the object's value and database value of the attribute.
    • getField

      public DatabaseField getField()
      INTERNAL: Returns the field which this mapping represents.
      Overrides:
      getField in class DatabaseMapping
      Returns:
      TODO
    • getFieldValue

      public abstract Object getFieldValue(Object objectValue, AbstractSession session)
      INTERNAL: Convert the object (attribute or property) value to a field value.
    • getObjectValue

      public abstract Object getObjectValue(Object fieldValue, Session session)
      INTERNAL: Allows for subclasses to convert the the attribute or property value.
    • hasConverter

      public boolean hasConverter()
      Indicates if the mapping has a converter set on it.
      Returns:
      true if there is a converter set on the mapping, false otherwise.
    • isAbstractColumnMapping

      public boolean isAbstractColumnMapping()
      INTERNAL:
      Overrides:
      isAbstractColumnMapping in class DatabaseMapping
    • isInsertable

      protected boolean isInsertable()
      INTERNAL: Return true if this mapping is insertable.
    • isUpdatable

      protected boolean isUpdatable()
      INTERNAL: Return true if this mapping is updatable.
    • iterate

      public void iterate(DescriptorIterator iterator)
      INTERNAL: Iterate on the appropriate attribute.
      Specified by:
      iterate in class DatabaseMapping
    • setConverter

      public void setConverter(Converter converter)
      PUBLIC: Set the converter on the mapping. A converter can be used to convert between the object's value and database value of the attribute.
    • setConverterClassName

      public void setConverterClassName(String converterClassName)
      PUBLIC: Set the converter class name on the mapping. It will be instantiated during the convertClassNamesToClasses. A converter can be used to convert between the object's value and database value of the attribute.
    • setField

      public void setField(DatabaseField theField)
      ADVANCED: Set the field in the mapping. This can be used for advanced field types, such as XML nodes, or to set the field type.
    • toString

      public String toString()
      INTERNAL:
      Overrides:
      toString in class DatabaseMapping
    • writeValueIntoRow

      protected abstract void writeValueIntoRow(AbstractRecord row, DatabaseField field, Object value)
      INTERNAL: