Class ArrayFactoryImpl

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.TimeZone timeZone  
    • Constructor Summary

      Constructors 
      Constructor Description
      ArrayFactoryImpl​(java.util.TimeZone timeZone)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.sql.ResultSet create​(ColumnMetaData.AvaticaType elementType, java.lang.Iterable<java.lang.Object> elements)
      Creates a ResultSet from the given list of values per Array.getResultSet().
      java.sql.Array createArray​(ColumnMetaData.AvaticaType elementType, java.lang.Iterable<java.lang.Object> elements)
      Creates an Array from the given list of values, converting any primitive values into the corresponding objects.
      private java.util.List<java.util.List<java.lang.Object>> createResultSetRowsForArrayData​(java.lang.Iterable<java.lang.Object> elements)
      Creates the row-level view over the values that will make up an Array.
      private java.util.Iterator<java.util.List<java.lang.Object>> createRowForArrayData​(java.util.List<java.lang.Object> elements)
      Creates an row-level view over the values that will make up an Array.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • timeZone

        private java.util.TimeZone timeZone
    • Constructor Detail

      • ArrayFactoryImpl

        public ArrayFactoryImpl​(java.util.TimeZone timeZone)
    • Method Detail

      • create

        public java.sql.ResultSet create​(ColumnMetaData.AvaticaType elementType,
                                         java.lang.Iterable<java.lang.Object> elements)
                                  throws java.sql.SQLException
        Description copied from interface: ArrayImpl.Factory
        Creates a ResultSet from the given list of values per Array.getResultSet().
        Specified by:
        create in interface ArrayImpl.Factory
        Parameters:
        elementType - The type of the elements
        elements - The elements
        Throws:
        java.sql.SQLException - on error
      • createArray

        public java.sql.Array createArray​(ColumnMetaData.AvaticaType elementType,
                                          java.lang.Iterable<java.lang.Object> elements)
        Description copied from interface: ArrayImpl.Factory
        Creates an Array from the given list of values, converting any primitive values into the corresponding objects.
        Specified by:
        createArray in interface ArrayImpl.Factory
        Parameters:
        elementType - The type of the elements
        elements - The elements
      • createResultSetRowsForArrayData

        private java.util.List<java.util.List<java.lang.Object>> createResultSetRowsForArrayData​(java.lang.Iterable<java.lang.Object> elements)
        Creates the row-level view over the values that will make up an Array. The Iterator has a row per Array element, each row containing two columns. The second column is the array element and the first column is the offset into the array of that array element (one-based, not zero-based).

        The ordering of the rows is not guaranteed to be in the same order as the array elements.

        A list of elements:

        [1, 2, 3]

        might be converted into

        Iterator{ [1, 1], [2, 2], [3, 3] }
        Parameters:
        elements - The elements of an array.
      • createRowForArrayData

        private java.util.Iterator<java.util.List<java.lang.Object>> createRowForArrayData​(java.util.List<java.lang.Object> elements)
        Creates an row-level view over the values that will make up an Array. The Iterator has one entry which has a list that also has one entry.

        A provided list of elements

        [1, 2, 3]

        would be converted into

        Iterator{ [ [1,2,3] ] }
        Parameters:
        elements - The elements of an array