Record Class FilterColumn
- Record Components:
tableName- native name of the tablecolumnName- native name of the filter columncolumnType- type of the filter column for sql generationfilterValue- fixed filter value as a condition to be included in the query, or${argName}to fill-in the argument name
- All Implemented Interfaces:
AdlSqlColumn, Serializable
FilterColumn defines an extra filter condition to be applied to a query, so the scope of the original query will be narrowed.
A good example might be a TENANT-column that is not mapped to any attribute. Instead the value of this column will be compared to a process
variable.
FilterColumns also allow for advanced querying on tables with different layouts.
Sometimes, a table may be organized in a way that the effective key is composed of two or more columns.
A FilterColumn is the definition of a column name and a fixed value to be included in the query when selecting rows.
+------+------------+-------------+ | ID | ENTRY_TYPE | ENTRY_VALUE | +------+------------+-------------+ | 8599 | MODEL | X4886 | +------+------------+-------------+ | 8599 | BRAND | RED | +------+------------+-------------+ | 4132 | COLOR | RED | +------+------------+-------------+ | ... | ... | ... |In the example above, multiple attributes of the logical data model are mapped to the
ENTRY_TYPE column, e.g., model,
brand and color.However, a query like
brand=RED must not be simply translated into SELECT ID FROM ... where ENTRY_VALUE='RED' because it
would also return ID=4132 - which is wrong. Instead, an additional filtering by ENTRY_TYPE is required:
SELECT ID FROM ... where ENTRY_TYPE='BRAND' AND ENTRY_VALUE='RED'.
To create more expressive configurations your can specify "${argName}" as the filterValue. Then the converter will
fill-in the current argument name from the expression as the filter value. This is meant for flat tables where the argument name acts as a qualifier for the
column holding the values.
Summary:
A FilterColumn is part of the mapping of a field of the logical data model to a column. It expresses an additional filter condition based on a column
name and its fixed or dynamic value (global variable reference).
FilterColumns defined on a table pre-filter the data of that table for any related query.
- Author:
- Karl Eilebrecht
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFilterColumn(String tableName, String columnName, AdlSqlType columnType, String filterValue) Creates an instance of aFilterColumnrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecolumnNamerecord component.Returns the value of thecolumnTyperecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefilterValuerecord component.final inthashCode()Returns a hash code value for this object.Returns the value of thetableNamerecord component.toString()Returns a string representation of this record class.
-
Field Details
-
VAR_ARG_NAME
Fixed value that can be specified as a filterValue to tell the system to replace it at runtime with the current argName from the expression.This variable is highly dynamic and only available (of interest) during parameter creation.
- See Also:
-
ARG_NAME_PLACEHOLDER
-
-
Constructor Details
-
FilterColumn
Creates an instance of aFilterColumnrecord class.- Parameters:
tableName- the value for thetableNamerecord componentcolumnName- the value for thecolumnNamerecord componentcolumnType- the value for thecolumnTyperecord componentfilterValue- the value for thefilterValuerecord component
-
-
Method Details
-
nativeCondition
- Returns:
- the native filter condition to be included in the SQL query
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
tableName
Returns the value of thetableNamerecord component.- Specified by:
tableNamein interfaceAdlSqlColumn- Returns:
- the value of the
tableNamerecord component
-
columnName
Returns the value of thecolumnNamerecord component.- Specified by:
columnNamein interfaceAdlSqlColumn- Returns:
- the value of the
columnNamerecord component
-
columnType
Returns the value of thecolumnTyperecord component.- Specified by:
columnTypein interfaceAdlSqlColumn- Returns:
- the value of the
columnTyperecord component
-
filterValue
Returns the value of thefilterValuerecord component.- Returns:
- the value of the
filterValuerecord component
-