Class TableMapping


  • public class TableMapping
    extends Object
    Mapping between column names being mapped to and the mapped column information
    Since:
    3.3.0
    Author:
    osbornb
    • Constructor Detail

      • TableMapping

        public TableMapping()
        Constructor
      • TableMapping

        public TableMapping​(String tableName,
                            List<? extends UserColumn> columns)
        Constructor
        Parameters:
        tableName - table name
        columns - user columns
      • TableMapping

        public TableMapping​(UserTable<? extends UserColumn> table)
        Constructor
        Parameters:
        table - user table
      • TableMapping

        public TableMapping​(UserTable<? extends UserColumn> table,
                            Collection<String> droppedColumnNames)
        Constructor
        Parameters:
        table - user table
        droppedColumnNames - dropped column names
      • TableMapping

        public TableMapping​(UserTable<? extends UserColumn> table,
                            String newTableName)
        Constructor
        Parameters:
        table - user table
        newTableName - new table name
      • TableMapping

        public TableMapping​(TableInfo tableInfo)
        Constructor
        Parameters:
        tableInfo - table info
      • TableMapping

        public TableMapping​(GeoPackageCoreConnection db,
                            String tableName)
        Constructor
        Parameters:
        db - connection
        tableName - table name
    • Method Detail

      • getFromTable

        public String getFromTable()
        Get the from table name
        Returns:
        from table name
      • setFromTable

        public void setFromTable​(String fromTable)
        Set the from table name
        Parameters:
        fromTable - from table name
      • getToTable

        public String getToTable()
        Get the to table name
        Returns:
        to table name
      • setToTable

        public void setToTable​(String toTable)
        Set the to table name
        Parameters:
        toTable - to table name
      • isNewTable

        public boolean isNewTable()
        Check if the table mapping is to a new table
        Returns:
        true if a new table
      • isTransferContent

        public boolean isTransferContent()
        Is the transfer content flag enabled
        Returns:
        true if data should be transfered to the new table
      • setTransferContent

        public void setTransferContent​(boolean transferContent)
        Set the transfer content flag
        Parameters:
        transferContent - true if data should be transfered to the new table
      • addColumn

        public void addColumn​(MappedColumn column)
        Add a column
        Parameters:
        column - mapped column
      • addColumn

        public void addColumn​(String columnName)
        Add a column
        Parameters:
        columnName - column name
      • removeColumn

        public MappedColumn removeColumn​(String columnName)
        Remove a column
        Parameters:
        columnName - column name
        Returns:
        removed mapped column or null
      • getColumnNames

        public Set<String> getColumnNames()
        Get the column names
        Returns:
        column names
      • getMappedColumns

        public Collection<MappedColumn> getMappedColumns()
        Get the mapped column values
        Returns:
        columns
      • getColumn

        public MappedColumn getColumn​(String columnName)
        Get the mapped column for the column name
        Parameters:
        columnName - column name
        Returns:
        mapped column
      • addDroppedColumn

        public void addDroppedColumn​(String columnName)
        Add a dropped column
        Parameters:
        columnName - column name
      • removeDroppedColumn

        public boolean removeDroppedColumn​(String columnName)
        Remove a dropped column
        Parameters:
        columnName - column name
        Returns:
        true if removed
      • getDroppedColumns

        public Set<String> getDroppedColumns()
        Get a set of dropped columns
        Returns:
        dropped columns
      • isDroppedColumn

        public boolean isDroppedColumn​(String columnName)
        Check if the column name is a dropped column
        Parameters:
        columnName - column name
        Returns:
        true if a dropped column
      • hasWhere

        public boolean hasWhere()
        Check if there is a custom where clause
        Returns:
        true if where clause
      • getWhere

        public String getWhere()
        Get the where clause
        Returns:
        where clause
      • setWhere

        public void setWhere​(String where)
        Set the where clause
        Parameters:
        where - where clause