Interface Table

    • Method Detail

      • getName

        String getName()
        Specified by:
        getName in interface TableDefinition
        Returns:
        The name of the table
        Usage:
        General: This method is general use.
      • isHidden

        boolean isHidden()
        Whether or not this table has been marked as hidden.
        Specified by:
        isHidden in interface TableDefinition
        Usage:
        General: This method is general use.
      • isSystem

        boolean isSystem()
        Whether or not this table is a system (internal) table.
        Specified by:
        isSystem in interface TableDefinition
        Usage:
        General: This method is general use.
      • getErrorHandler

        ErrorHandler getErrorHandler()
        Gets the currently configured ErrorHandler (always non-null). This will be used to handle all errors unless overridden at the Cursor level.
        Usage:
        Intermediate: This method requires moderate API knowledge.
      • setErrorHandler

        void setErrorHandler​(ErrorHandler newErrorHandler)
        Sets a new ErrorHandler. If null, resets to using the ErrorHandler configured at the Database level.
        Usage:
        Intermediate: This method requires moderate API knowledge.
      • isAllowAutoNumberInsert

        boolean isAllowAutoNumberInsert()
        Gets the currently configured auto number insert policy.
        See Also:
        Database.isAllowAutoNumberInsert()
        Usage:
        Intermediate: This method requires moderate API knowledge.
      • setAllowAutoNumberInsert

        void setAllowAutoNumberInsert​(Boolean allowAutoNumInsert)
        Sets the new auto number insert policy for the Table. If null, resets to using the policy configured at the Database level.
        Usage:
        Intermediate: This method requires moderate API knowledge.
      • getColumns

        List<? extends Column> getColumns()
        Specified by:
        getColumns in interface TableDefinition
        Returns:
        All of the columns in this table (unmodifiable List)
        Usage:
        General: This method is general use.
      • getColumn

        Column getColumn​(String name)
        Specified by:
        getColumn in interface TableDefinition
        Returns:
        the column with the given name
        Usage:
        General: This method is general use.
      • getNameMap

        TableNameMap getNameMap()
                         throws IOException
        Returns:
        the name map for this table, or null if the table has none
        Throws:
        IOException
        Usage:
        Intermediate: This method requires moderate API knowledge.
      • getUpdatedDate

        LocalDateTime getUpdatedDate()
                              throws IOException
        Note: jackcess does not automatically update the modified date of a Table.
        Specified by:
        getUpdatedDate in interface TableDefinition
        Returns:
        the last updated date for this table if available
        Throws:
        IOException
        Usage:
        General: This method is general use.
      • getIndexes

        List<? extends Index> getIndexes()
        Specified by:
        getIndexes in interface TableDefinition
        Returns:
        All of the Indexes on this table (unmodifiable List)
        Usage:
        Intermediate: This method requires moderate API knowledge.
      • getForeignKeyIndex

        Index getForeignKeyIndex​(Table otherTable)
        Specified by:
        getForeignKeyIndex in interface TableDefinition
        Returns:
        the foreign key index joining this table to the given other table
        Throws:
        IllegalArgumentException - if there is no relationship between this table and the given table
        Usage:
        Intermediate: This method requires moderate API knowledge.
      • asRow

        Object[] asRow​(Map<String,​?> rowMap)
        Converts a map of columnName -> columnValue to an array of row values appropriate for a call to addRow(Object...).
        Usage:
        General: This method is general use.
      • getRowCount

        int getRowCount()
        Usage:
        General: This method is general use.
      • addRow

        Object[] addRow​(Object... row)
                 throws IOException
        Adds a single row to this table and writes it to disk. The values are expected to be given in the order that the Columns are listed by the getColumns() method. This is by default the storage order of the Columns in the database, however this order can be influenced by setting the ColumnOrder via Database.setColumnOrder(com.healthmarketscience.jackcess.Table.ColumnOrder) prior to opening the Table. The asRow(java.util.Map<java.lang.String, ?>) method can be used to easily convert a row Map into the appropriate row array for this Table.

        Note, if this table has an auto-number column, the value generated will be put back into the given row array (assuming the given row array is at least as long as the number of Columns in this Table).

        Parameters:
        row - row values for a single row. the given row array will be modified if this table contains an auto-number column, otherwise it will not be modified.
        Returns:
        the given row values if long enough, otherwise a new array. the returned array will contain any autonumbers generated
        Throws:
        IOException
        Usage:
        General: This method is general use.
      • addRows

        List<? extends Object[]> addRows​(List<? extends Object[]> rows)
                                  throws IOException
        Add multiple rows to this table, only writing to disk after all rows have been written, and every time a data page is filled. This is much more efficient than calling addRow(java.lang.Object...) multiple times.

        Note, if this table has an auto-number column, the values written will be put back into the given row arrays (assuming the given row array is at least as long as the number of Columns in this Table).

        Most exceptions thrown from this method will be wrapped with a BatchUpdateException which gives useful information in the case of a partially successful write.

        Parameters:
        rows - List of Object[] row values. the rows will be modified if this table contains an auto-number column, otherwise they will not be modified.
        Returns:
        the given row values list (unless row values were to small), with appropriately sized row values (the ones passed in if long enough). the returned arrays will contain any autonumbers generated
        Throws:
        IOException
        See Also:
        for more details on row arrays
        Usage:
        General: This method is general use.
      • updateRow

        Row updateRow​(Row row)
               throws IOException
        Update the given row. Provided Row must have previously been returned from this Table.
        Returns:
        the given row, updated with the current row values
        Throws:
        IllegalStateException - if the given row is not valid, or deleted.
        IOException
      • iterator

        Iterator<Row> iterator()
        Calls reset() on this table and returns a modifiable Iterator which will iterate through all the rows of this table. Use of the Iterator follows the same restrictions as a call to getNextRow().

        For more advanced iteration, use the default cursor directly.

        Specified by:
        iterator in interface Iterable<Row>
        Throws:
        UncheckedIOException - if an IOException is thrown by one of the operations, the actual exception will be contained within
        Usage:
        General: This method is general use.
      • stream

        default Stream<Row> stream()
        Returns:
        a Stream using the default Iterator.
      • getNextRow

        Row getNextRow()
                throws IOException
        Returns:
        The next row in this table (Column name -> Column value) (uses the default cursor)
        Throws:
        IOException
        Usage:
        General: This method is general use.
      • getDefaultCursor

        Cursor getDefaultCursor()
        Returns:
        a simple Cursor, initialized on demand and held by this table. This cursor backs the row traversal methods available on the Table interface. For advanced Table traversal and manipulation, use the Cursor directly.
      • newCursor

        CursorBuilder newCursor()
        Convenience method for constructing a new CursorBuilder for this Table.
      • newBlob

        default OleBlob.Builder newBlob()
        Convenience method for constructing a new OleBlob.Builder.