Package com.mckoi.database
Class ReferenceTable
java.lang.Object
com.mckoi.database.Table
com.mckoi.database.FilterTable
com.mckoi.database.ReferenceTable
- All Implemented Interfaces:
RootTable
,TableDataSource
This is an implementation of a Table that references a DataTable as its
parent. This is a one-to-one relationship unlike the VirtualTable class
which is a one-to-many relationship.
The entire purpose of this class is as a filter. We can use it to rename a DataTable class to any domain we feel like. This allows us to generate unique column names.
For example, say we need to join the same table. We can use this method to ensure that the newly joined table won't have duplicate column names.
This object implements RootTable.
- Author:
- Tobias Downer
-
Field Summary
Fields inherited from class com.mckoi.database.FilterTable
parent
Fields inherited from class com.mckoi.database.Table
DEBUG_QUERY
-
Method Summary
Modifier and TypeMethodDescriptionint
Given a fully qualified variable field name, ie.Returns the 'modified' DataTableDef object for this reference.getResolvedVariable
(int column) Returns a fully qualified Variable object that represents the name of the column at the given index.Filters the name of the table.boolean
typeEquals
(RootTable table) This is function is used to check that two root tables are identical.Methods inherited from class com.mckoi.database.FilterTable
getCellContents, getColumnCount, getDatabase, getParent, getRowCount, hasRootsLocked, lockRoot, printGraph, rowEnumeration, unlockRoot
Methods inherited from class com.mckoi.database.Table
all, allColumnMatchesValue, any, columnContainsCell, columnContainsValue, columnMatchesValue, columnMerge, compareCells, Debug, distinct, distinct, dumpTo, emptySelect, exhaustiveSelect, fastFindFieldName, getColumnDefAt, getColumnScheme, getFirstCellContent, getFirstCellContent, getLastCellContent, getLastCellContent, getSingleCellContent, getSingleCellContent, getSystem, getTableAccessState, getTTypeForColumn, getTTypeForColumn, join, orderByColumn, orderByColumn, orderByColumn, orderByColumns, orderedRowList, outside, rangeSelect, selectAll, selectAll, selectFirst, selectLast, selectRange, selectRest, simpleJoin, simpleSelect, singleRowSelect, toMap, toString, union
-
Method Details
-
getTableName
Filters the name of the table. This returns the declared name of the table. -
getDataTableDef
Returns the 'modified' DataTableDef object for this reference.- Specified by:
getDataTableDef
in interfaceTableDataSource
- Overrides:
getDataTableDef
in classFilterTable
-
findFieldName
Given a fully qualified variable field name, ie. 'APP.CUSTOMER.CUSTOMERID' this will return the column number the field is at. Returns -1 if the field does not exist in the table.- Overrides:
findFieldName
in classFilterTable
-
getResolvedVariable
Returns a fully qualified Variable object that represents the name of the column at the given index. For example, new Variable(new TableName("APP", "CUSTOMER"), "ID")- Overrides:
getResolvedVariable
in classFilterTable
-
typeEquals
Description copied from interface:RootTable
This is function is used to check that two root tables are identical. This is used if we need to chect that the form of the table is the same. Such as in a union operation, when we can only union two tables with the identical columns.- Specified by:
typeEquals
in interfaceRootTable
-