Class RowDescriptor

  • All Implemented Interfaces:
    java.lang.Iterable<FieldDescriptor>

    public final class RowDescriptor
    extends java.lang.Object
    implements java.lang.Iterable<FieldDescriptor>
    The class RowDescriptor is a java mapping of the XSQLDA server data structure used to describe the row metadata of one row for input or output.

    RowDescriptor is an immutable, values of a row are maintained separately in a RowValue.

    Author:
    Mark Rotteveel
    • Method Detail

      • getCount

        public int getCount()
        Returns:
        The number of fields.
      • getFieldDescriptor

        public FieldDescriptor getFieldDescriptor​(int index)
        Gets the FieldDescriptor at the specified (0-based) index.
        Parameters:
        index - 0-based index of the field
        Returns:
        FieldDescriptor
        Throws:
        java.lang.IndexOutOfBoundsException - if index is not 0 <= index < getCount
      • getFieldDescriptors

        public java.util.List<FieldDescriptor> getFieldDescriptors()
        Returns:
        An unmodifiable List of the FieldDescriptor instances of this row.
      • createDefaultFieldValues

        public RowValue createDefaultFieldValues()
        Creates a RowValue instance with default (null) values for each field.

        All fields are marked as uninitialized.

        The (0-based) index of the each field value in the RowValue corresponds with the (0-based) index of the FieldDescriptor within this RowDescriptor.

        Returns:
        Uninitialized and empty RowValue instance for a row described by this descriptor.
        See Also:
        RowValue.defaultFor(RowDescriptor)
      • createDeletedRowMarker

        public RowValue createDeletedRowMarker()
        Creates a deleted row marker.

        A deleted row marker is used in JDBC result sets for deleted rows, and to discern them from (updated) rows that are simply all NULL. This is for Jaybird internal implementation needs only.

        Returns:
        Deleted row marker with count number of rows, all set to null
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • createRowDescriptor

        public static RowDescriptor createRowDescriptor​(FieldDescriptor[] fieldDescriptors,
                                                        DatatypeCoder datatypeCoder)
        Creates an instance of RowDescriptor with the supplied FieldDescriptor instances.
        Parameters:
        fieldDescriptors - The field descriptors (array is cloned before use)
        datatypeCoder - he datatype code for the connection that uses this RowDescriptor.
        Returns:
        RowDescriptor instance
      • empty

        public static RowDescriptor empty​(DatatypeCoder datatypeCoder)
        Returns an empty row descriptor with the specified datatype coder.
        Parameters:
        datatypeCoder - The datatype code for the connection that uses this RowDescriptor.
        Returns:
        Empty row descriptor