Class 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:
    Serialized Form
    • Field Detail

      • structureName

        protected String structureName
      • orderedFields

        protected Vector orderedFields
      • allOrderedFields

        protected Vector allOrderedFields
    • Constructor Detail

      • ObjectRelationalDataTypeDescriptor

        public ObjectRelationalDataTypeDescriptor()
    • Method Detail

      • 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.
      • 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
      • 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
      • 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.
      • 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​(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.