Class RowIdSupport

java.lang.Object
net.sf.jailer.datamodel.RowIdSupport

public class RowIdSupport extends Object
Support for rowids.
Author:
Ralf Wisser
  • Constructor Details

    • RowIdSupport

      public RowIdSupport(DataModel dataModel, DBMS configuration, String rowIdType, boolean useRowIds, boolean useRowIdsOnlyForTablesWithoutPK)
      Constructor.
      Parameters:
      dataModel - the data model
      configuration - DBMS configuration
      rowIdType - type of rowid-columns
      useRowIds - true iff rowid column is used instead of primary keys
      useRowIdsOnlyForTablesWithoutPK - true to use rowids only for tables without a primary key
    • RowIdSupport

      public RowIdSupport(DataModel dataModel, DBMS configuration, boolean useRowIds, boolean useRowIdsOnlyForTablesWithoutPK)
      Constructor.
      Parameters:
      dataModel - the data model
      configuration - DBMS configuration
      useRowIds - true iff rowid column is used instead of primary keys
      useRowIdsOnlyForTablesWithoutPK - true to use rowids only for tables without a primary key
    • RowIdSupport

      public RowIdSupport(DataModel dataModel, DBMS configuration, String rowIdType, ExecutionContext executionContext)
      Constructor.
      Parameters:
      dataModel - the data model
      configuration - DBMS configuration
      rowIdType - type of rowid-columns
    • RowIdSupport

      public RowIdSupport(DataModel dataModel, DBMS configuration, ExecutionContext executionContext)
      Constructor.
      Parameters:
      dataModel - the data model
      configuration - DBMS configuration
  • Method Details

    • getPrimaryKey

      public PrimaryKey getPrimaryKey(Table table, Session session, boolean exact)
      Gets the primary key of a table.
      Parameters:
      table - the table
      session - the session, or null
      exact - true to check rowid applicability exactly against the database
      Returns:
      the primary key of the table
    • getPrimaryKey

      public PrimaryKey getPrimaryKey(Table table, Session session)
      Gets the primary key of a table.
      Parameters:
      table - the table
      session - the session, or null
      Returns:
      the primary key of the table
    • getPrimaryKey

      public PrimaryKey getPrimaryKey(Table table)
      Gets the primary key of a table.
      Parameters:
      table - the table
      Returns:
      the primary key of the table
    • getUniversalPrimaryKey

      public PrimaryKey getUniversalPrimaryKey(Session session)
      Gets the universal primary key.
      Parameters:
      session - for null value guessing
      Returns:
      the universal primary key
    • getUniversalPrimaryKey

      public PrimaryKey getUniversalPrimaryKey()
      Gets the universal primary key.
      Returns:
      the universal primary key
    • setUseRowIdsOnlyForTablesWithoutPK

      public void setUseRowIdsOnlyForTablesWithoutPK(boolean useRowIdsOnlyForTablesWithoutPK)
      Sets whether rowids should only be used for tables without a primary key.
      Parameters:
      useRowIdsOnlyForTablesWithoutPK - true to use rowids only for tables without a primary key
    • getColumns

      public List<Column> getColumns(Table table, Session session)
      Gets the columns with additional rowid-column of a table.
      Parameters:
      table - the table
      session - the session, or null
      Returns:
      the columns of the table, including the rowid-column if applicable
    • getColumns

      public List<Column> getColumns(Table table, Session session, boolean exact)
      Gets the columns with additional rowid-column of a table.
      Parameters:
      table - the table
      session - the session, or null
      exact - true to check rowid applicability exactly against the database
      Returns:
      the columns of the table, including the rowid-column if applicable
    • isRowIdColumn

      public boolean isRowIdColumn(Column column)
      Checks whether the given column is the rowid column.
      Parameters:
      column - the column to check
      Returns:
      true if the given column is the rowid column