Package com.pullreports.model
Class Table
Object
com.pullreports.model.Table
-
Method Summary
Modifier and TypeMethodDescriptionfindColumn
(ColumnId id) Returns an Optional whose value is the Table which is an immediate child of the current table with the given TableId.Returns an Optional whose value is the Table found at the given path or the empty Optional.Returns an Optional whose value is the Relationship found at the given path or the empty Optional.Returns the immutable List of Table columns.Returns an Optional whose value is this Table's human description or the empty Optional.boolean
getId()
Returns the id of the table.getName()
Returns an Optional whose value is the name of the database object to use within the SQL from clause.Returns the parentRelationship
of this table or the empty Optional if this is theReport
's base table.getPath()
Returns the List of Filter objects which should always apply to the Table if included in the export results or an empty List.Returns a Set of ColumnId's which represent the table's primary key columns or an empty Set.int
Returns the index of the given Column in this Table's List of Columns or an int less than 0.boolean
Returns true if this table is the base table of theReport
.Returns the Column for the given id.toString()
-
Method Details
-
getHasCompletePrimaryKeyColumns
public boolean getHasCompletePrimaryKeyColumns()- Returns:
- true if this table and all descendant,
getRelationships()
tables define a non-emptygetPrimaryKeyColumnIds()
Set if any descendant relationship is ofCardinality.MANY
.Used to determine if a
Report
's base table supports jsontree and htmltree exports. For tree exports formats, it is required that allTable
s which have at least one descendantRelationship
ofCardinality.MANY
define a non-emptygetPrimaryKeyColumnIds()
in order to correctly export relationship data.
-
getName
Returns an Optional whose value is the name of the database object to use within the SQL from clause. The value is typically the table name. May be the empty Optional ifgetSubqueryProvider()
is non-null.- Returns:
- an Optional with the table name as value or the empty Optional.
-
getPath
-
getColumns
Returns the immutable List of Table columns.- Returns:
- an immutable List of Columns.
-
getPrimaryKeyColumnIds
Returns a Set of ColumnId's which represent the table's primary key columns or an empty Set. Required for jsontree and htmltree export formats.- Returns:
- the table's primary key ColumnIds or the empty Set.
-
getDisplayName
-
getDescription
Returns an Optional whose value is this Table's human description or the empty Optional.- Returns:
- An Optional with the Table's description or the empty Optional.
-
getId
Returns the id of the table. This id must be unique in all relational child Tables of the same parent Table.- Returns:
- this Table's unique id.
-
getPreFilters
Returns the List of Filter objects which should always apply to the Table if included in the export results or an empty List.- Returns:
- the list of pre-Filters or an empty List.
-
getRelationships
-
getSubqueryProvider
-
getParentRelationship
Returns the parentRelationship
of this table or the empty Optional if this is theReport
's base table.- Returns:
- the parent Relationship or the empty Optional if this is the report's base table.
-
indexOf
Returns the index of the given Column in this Table's List of Columns or an int less than 0.- Parameters:
column
- The search column- Returns:
- the index of the column in the Table's List of Columns or an int less than 0.
-
findColumn
-
requireColumn
Returns the Column for the given id.- Parameters:
id
- The id of the column to require- Returns:
- returns the Column for the given id from the Table's list of columns.
- Throws:
NoSuchElementException
- if a Column with the given id is not found.
-
getChild
Returns an Optional whose value is the Table which is an immediate child of the current table with the given TableId.- Parameters:
tableId
- TableId which is the id of an immediate relationship child of this table.- Returns:
- an Optional with the Table at the given TableId or the empty Optional.
-
getChild
Returns an Optional whose value is the Table found at the given path or the empty Optional.- Parameters:
path
- TablePath relative to the path of this Table.- Returns:
- an Optional with the Table at the given path or the empty Optional.
-
getChildRelationship
Returns an Optional whose value is the Relationship found at the given path or the empty Optional.- Parameters:
path
- TablePath relative to the path of this Table.- Returns:
- an Optional with the Relationship at the given path or the empty Optional.
-
isBaseTable
public boolean isBaseTable()Returns true if this table is the base table of theReport
.- Returns:
- true if this table is the base table.
-
toString
-