Package mil.nga.geopackage.db
Class TableMapping
- java.lang.Object
-
- mil.nga.geopackage.db.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 Summary
Constructors Constructor Description TableMapping()
ConstructorTableMapping(String tableName, List<? extends UserColumn> columns)
ConstructorTableMapping(GeoPackageCoreConnection db, String tableName)
ConstructorTableMapping(TableInfo tableInfo)
ConstructorTableMapping(UserTable<? extends UserColumn> table)
ConstructorTableMapping(UserTable<? extends UserColumn> table, String newTableName)
ConstructorTableMapping(UserTable<? extends UserColumn> table, Collection<String> droppedColumnNames)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addColumn(String columnName)
Add a columnvoid
addColumn(MappedColumn column)
Add a columnvoid
addDroppedColumn(String columnName)
Add a dropped columnMappedColumn
getColumn(String columnName)
Get the mapped column for the column nameSet<String>
getColumnNames()
Get the column namesSet<Map.Entry<String,MappedColumn>>
getColumns()
Get the columns as an entry setSet<String>
getDroppedColumns()
Get a set of dropped columnsString
getFromTable()
Get the from table nameCollection<MappedColumn>
getMappedColumns()
Get the mapped column valuesString
getToTable()
Get the to table nameString
getWhere()
Get the where clauseboolean
hasWhere()
Check if there is a custom where clauseboolean
isDroppedColumn(String columnName)
Check if the column name is a dropped columnboolean
isNewTable()
Check if the table mapping is to a new tableboolean
isTransferContent()
Is the transfer content flag enabledMappedColumn
removeColumn(String columnName)
Remove a columnboolean
removeDroppedColumn(String columnName)
Remove a dropped columnvoid
setFromTable(String fromTable)
Set the from table namevoid
setToTable(String toTable)
Set the to table namevoid
setTransferContent(boolean transferContent)
Set the transfer content flagvoid
setWhere(String where)
Set the where clause
-
-
-
Constructor Detail
-
TableMapping
public TableMapping()
Constructor
-
TableMapping
public TableMapping(String tableName, List<? extends UserColumn> columns)
Constructor- Parameters:
tableName
- table namecolumns
- 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 tabledroppedColumnNames
- dropped column names
-
TableMapping
public TableMapping(UserTable<? extends UserColumn> table, String newTableName)
Constructor- Parameters:
table
- user tablenewTableName
- new table name
-
TableMapping
public TableMapping(TableInfo tableInfo)
Constructor- Parameters:
tableInfo
- table info
-
TableMapping
public TableMapping(GeoPackageCoreConnection db, String tableName)
Constructor- Parameters:
db
- connectiontableName
- 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
-
getColumns
public Set<Map.Entry<String,MappedColumn>> getColumns()
Get the columns as an entry set- Returns:
- columns
-
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
-
-