Class ObjectRelationalDataTypeDescriptor

java.lang.Object
org.eclipse.persistence.core.descriptors.CoreDescriptor<AttributeGroup,DescriptorEventManager,org.eclipse.persistence.internal.helper.DatabaseField,InheritancePolicy,org.eclipse.persistence.internal.descriptors.InstantiationPolicy,Vector,org.eclipse.persistence.internal.descriptors.ObjectBuilder>
org.eclipse.persistence.descriptors.ClassDescriptor
org.eclipse.persistence.descriptors.RelationalDescriptor
org.eclipse.persistence.mappings.structures.ObjectRelationalDataTypeDescriptor
All Implemented Interfaces:
Serializable, Cloneable

public class ObjectRelationalDataTypeDescriptor extends RelationalDescriptor

Purpose: Differentiates object-relational descriptors from normal relational descriptors. The object-relational descriptor describes a type not a table, (although there is normally a table associated with the type, unless it is aggregate).

See Also:
  • Field Details

    • structureName

      protected String structureName
    • orderedFields

      protected Vector orderedFields
    • allOrderedFields

      protected Vector allOrderedFields
  • Constructor Details

    • ObjectRelationalDataTypeDescriptor

      public ObjectRelationalDataTypeDescriptor()
  • Method Details

    • initialize

      public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorException
      INTERNAL: Auto-Default orderedFields to fields
      Overrides:
      initialize in class ClassDescriptor
      Throws:
      DescriptorException
    • addFieldOrdering

      public void addFieldOrdering(String fieldName)
      PUBLIC: Order the fields in a specific Add the field ordering, this will order the fields in the order this method is called.
      Parameters:
      fieldName - the name of the field to add ordering on.
    • buildDirectValuesFromFieldValue

      public Vector buildDirectValuesFromFieldValue(Object fieldValue) throws DatabaseException
      INTERNAL: Extract the direct values from the specified field value. Return them in a vector. The field value better be an Array.
      Overrides:
      buildDirectValuesFromFieldValue in class ClassDescriptor
      Throws:
      DatabaseException
    • buildFieldValueFromDirectValues

      public Object buildFieldValueFromDirectValues(Vector directValues, String elementDataTypeName, org.eclipse.persistence.internal.sessions.AbstractSession session) throws DatabaseException
      INTERNAL: Build the appropriate field value for the specified set of direct values. The database better be expecting an ARRAY.
      Overrides:
      buildFieldValueFromDirectValues in class ClassDescriptor
      Throws:
      DatabaseException
    • buildFieldValueFromNestedRow

      public Object buildFieldValueFromNestedRow(org.eclipse.persistence.internal.sessions.AbstractRecord nestedRow, org.eclipse.persistence.internal.sessions.AbstractSession session) throws DatabaseException
      INTERNAL: Build and return the field value from the specified nested database row. The database better be expecting a Struct.
      Overrides:
      buildFieldValueFromNestedRow in class ClassDescriptor
      Throws:
      DatabaseException
    • buildFieldValueFromNestedRows

      public Object buildFieldValueFromNestedRows(Vector nestedRows, String structureName, org.eclipse.persistence.internal.sessions.AbstractSession session) throws DatabaseException
      INTERNAL: Build and return the appropriate field value for the specified set of nested rows. The database better be expecting an ARRAY. It looks like we can ignore inheritance here....
      Overrides:
      buildFieldValueFromNestedRows in class ClassDescriptor
      Throws:
      DatabaseException
    • buildContainerFromArray

      public static Object buildContainerFromArray(Array fieldValue, ObjectRelationalDatabaseField arrayField, org.eclipse.persistence.internal.sessions.AbstractSession session) throws DatabaseException
      INTERNAL: Build and return the nested rows from the specified field value. This method allows the field value to be an ARRAY containing other structures such as arrays or Struct, or direct values.
      Throws:
      DatabaseException
    • buildNestedRowFromFieldValue

      public org.eclipse.persistence.internal.sessions.AbstractRecord buildNestedRowFromFieldValue(Object fieldValue) throws DatabaseException
      INTERNAL: Build and return the nested database row from the specified field value. The field value better be an Struct.
      Overrides:
      buildNestedRowFromFieldValue in class ClassDescriptor
      Throws:
      DatabaseException
    • buildNestedRowsFromFieldValue

      public Vector buildNestedRowsFromFieldValue(Object fieldValue, org.eclipse.persistence.internal.sessions.AbstractSession session) throws DatabaseException
      INTERNAL: Build and return the nested rows from the specified field value. The field value better be an ARRAY.
      Overrides:
      buildNestedRowsFromFieldValue in class ClassDescriptor
      Throws:
      DatabaseException
    • buildRowFromStructure

      public org.eclipse.persistence.internal.sessions.AbstractRecord buildRowFromStructure(Struct structure) throws DatabaseException
      INTERNAL: Build a row representation from the ADT structure field array. TopLink will then build the object from the row.
      Throws:
      DatabaseException
    • buildStructureFromRow

      public Struct buildStructureFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session, Connection connection) throws DatabaseException
      INTERNAL: Build a ADT structure from the row data.
      Throws:
      DatabaseException
    • buildArrayObjectFromArray

      public static Object buildArrayObjectFromArray(Object array) throws DatabaseException
      INTERNAL: Build array of objects for Array data type.
      Throws:
      DatabaseException
    • buildArrayObjectFromStruct

      public static Object buildArrayObjectFromStruct(Object structure) throws DatabaseException
      INTERNAL: Build array of objects for Struct data type.
      Throws:
      DatabaseException
    • extractDefaultTable

      protected org.eclipse.persistence.internal.helper.DatabaseTable extractDefaultTable()
      INTERNAL: Aggregates use a dummy table as default.
      Overrides:
      extractDefaultTable in class ClassDescriptor
    • getOrderedFields

      public Vector getOrderedFields()
      INTERNAL: Return the field order.
    • getRef

      public Ref getRef(Object object, org.eclipse.persistence.internal.sessions.AbstractSession session)
      INTERNAL: Get the ref for the object. This is required for use by Refs, there might be a better way to do it when objID are supported. (i.e. getting it from the object or identity map).
    • getStructureName

      public String getStructureName()
      PUBLIC: Return the name of the structure. This is the name of the user defined data type as defined on the database.
    • isObjectRelationalDataTypeDescriptor

      public boolean isObjectRelationalDataTypeDescriptor()
      PUBLIC: Return if this is an ObjectRelationalDataTypeDescriptor.
      Overrides:
      isObjectRelationalDataTypeDescriptor in class ClassDescriptor
    • requiresInitialization

      public boolean requiresInitialization(org.eclipse.persistence.internal.sessions.AbstractSession session)
      INTERNAL: Aggregates obj-rel are initialized normally as no cloning is required.
      Overrides:
      requiresInitialization in class ClassDescriptor
    • validateMappingType

      protected void validateMappingType(DatabaseMapping mapping)
      Overrides:
      validateMappingType in class ClassDescriptor
    • setOrderedFields

      public void setOrderedFields(Vector orderedFields)
      INTERNAL: Set the field order.
    • setStructureName

      public void setStructureName(String structureName)
      PUBLIC: Set the name of the structure. This is the name of the user defined data type as defined on the database.