Package lumis.doui.table.field
Class TableSourceFieldMapping
- java.lang.Object
-
- lumis.doui.table.field.TableSourceFieldMapping
-
@StableMinor(version="15.0", sinceVersion="4.0") public class TableSourceFieldMapping extends java.lang.Object
Used to define the mapping between source fields and the database- Since:
- 4.0.4
- Version:
- $Revision: 25304 $ $Date: 2022-10-22 22:51:05 -0300 (Sat, 22 Oct 2022) $
-
-
Constructor Summary
Constructors Constructor Description TableSourceFieldMapping()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addField(QueryField field)
Adds a field in this mapping.QueryTable
addTable(java.lang.String newTableName, java.lang.String newTableColumn, QueryTable joinTable, java.lang.String joinTableColumn)
Adds a table to this mapping, including a join filter with it.protected void
applyField(QuerySelect querySelect, QueryField field)
Adds a field to be returned by the given query.protected void
applyFilter(QuerySelect querySelect, IQueryFilter filter)
Applies a filter to the given query.void
applyMapping(QuerySelect querySelect)
protected void
applyTable(QuerySelect querySelect, QueryTable table)
Includes a table in a query.protected void
applyTableJoins(QuerySelect querySelect, QueryTable table)
Includes in a query the joins of a given table.java.util.List<QueryField>
getFieldsToSelect()
IQueryFilter
getFilter()
java.util.List<QueryFilter>
getJoins()
java.util.List<QueryTable>
getTables()
void
setFilter(IQueryFilter filter)
-
-
-
Method Detail
-
addTable
public QueryTable addTable(java.lang.String newTableName, java.lang.String newTableColumn, QueryTable joinTable, java.lang.String joinTableColumn)
Adds a table to this mapping, including a join filter with it. The filter will set the joinTableColumn on the left and the newTableColumn on the right.- Parameters:
newTableName
- the name of the table to be added.newTableColumn
- the column of the new table that will be used for the join filter.joinTable
- the table with whom the new table will be joined with.joinTableColumn
- the column ofjoinTable
that will be used for the join filter.- Returns:
- the new table instance, already added to this mapping.
- Since:
- 4.0.4
-
addField
public void addField(QueryField field)
Adds a field in this mapping.- Parameters:
field
- the field to add.- Since:
- 4.0.4
-
applyMapping
public void applyMapping(QuerySelect querySelect)
-
applyFilter
protected void applyFilter(QuerySelect querySelect, IQueryFilter filter)
Applies a filter to the given query.- Parameters:
querySelect
- the select query.filter
- the filter to be applied.- Since:
- 4.2.0
-
applyField
protected void applyField(QuerySelect querySelect, QueryField field)
Adds a field to be returned by the given query.- Parameters:
querySelect
- the select query.field
- the field.- Since:
- 4.2.0
-
applyTable
protected void applyTable(QuerySelect querySelect, QueryTable table)
Includes a table in a query. Must also verifies if the table should or should not be included. If it should not be included (e.g. it represents a table that is already in the query), this method must return without performing any change.- Parameters:
querySelect
- the select query.table
- the table.- Since:
- 4.2.0
-
applyTableJoins
protected void applyTableJoins(QuerySelect querySelect, QueryTable table)
Includes in a query the joins of a given table.This method is called by
applyTable(QuerySelect, QueryTable)
after the table is included in the query.- Parameters:
querySelect
- the select query.table
- the table whose joins are to be included.- Since:
- 4.2.0
-
getFieldsToSelect
public java.util.List<QueryField> getFieldsToSelect()
-
getFilter
public IQueryFilter getFilter()
-
setFilter
public void setFilter(IQueryFilter filter)
-
getJoins
public java.util.List<QueryFilter> getJoins()
-
getTables
public java.util.List<QueryTable> getTables()
-
-