Class ObjectRelationalDataTypeDescriptor

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.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:
    Serialized Form
    • Field Detail

      • structureName

        protected java.lang.String structureName
      • orderedFields

        protected java.util.Vector orderedFields
      • allOrderedFields

        protected java.util.Vector allOrderedFields
    • Constructor Detail

      • ObjectRelationalDataTypeDescriptor

        public ObjectRelationalDataTypeDescriptor()
    • Method Detail

      • addFieldOrdering

        public void addFieldOrdering​(java.lang.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.
      • buildFieldValueFromDirectValues

        public java.lang.Object buildFieldValueFromDirectValues​(java.util.Vector directValues,
                                                                java.lang.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 java.lang.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 java.lang.Object buildFieldValueFromNestedRows​(java.util.Vector nestedRows,
                                                              java.lang.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 java.lang.Object buildContainerFromArray​(java.sql.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​(java.lang.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 java.util.Vector buildNestedRowsFromFieldValue​(java.lang.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​(java.sql.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 java.sql.Struct buildStructureFromRow​(org.eclipse.persistence.internal.sessions.AbstractRecord row,
                                                     org.eclipse.persistence.internal.sessions.AbstractSession session,
                                                     java.sql.Connection connection)
                                              throws DatabaseException
        INTERNAL: Build a ADT structure from the row data.
        Throws:
        DatabaseException
      • buildArrayObjectFromArray

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

        public static java.lang.Object buildArrayObjectFromStruct​(java.lang.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 java.util.Vector getOrderedFields()
        INTERNAL: Return the field order.
      • getRef

        public java.sql.Ref getRef​(java.lang.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 java.lang.String getStructureName()
        PUBLIC: Return the name of the structure. This is the name of the user defined data type as defined on the database.
      • 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
      • setOrderedFields

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

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