Package de.calamanari.adl.sql.cnv
Interface SqlConversionProcessContext
- All Superinterfaces:
de.calamanari.adl.ProcessContext
- All Known Implementing Classes:
ResettableScpContext
public interface SqlConversionProcessContext
extends de.calamanari.adl.ProcessContext
This interface provides access to the variables, flags and the binding in the context of the current conversion.
It also allows the registration of new parameters created during a conversion run.
It also allows the registration of new parameters created during a conversion run.
- Author:
- Karl Eilebrecht
-
Method Summary
Modifier and TypeMethodDescriptiondefault StringResolves the main id-column for joining further tables.The main table is the table to start the query with.de.calamanari.adl.FormatStylegetStyle()voidregisterParameter(QueryParameter parameter) Registers a query parameter of the current query.Methods inherited from interface de.calamanari.adl.ProcessContext
getGlobalFlags, getGlobalVariables
-
Method Details
-
getDataBinding
DataBinding getDataBinding()- Returns:
- the configured data binding of the converter
-
registerParameter
Registers a query parameter of the current query.Only registered parameters can later be applied to the final script.
- Parameters:
parameter-
-
getRegisteredParameters
List<QueryParameter> getRegisteredParameters()- Returns:
- list of all parameters registered during the current conversion run
- See Also:
-
getMainTable
TableMetaInfo getMainTable()The main table is the table to start the query with. It is initialized withDataTableConfig.primaryTable().Depending on the conversion strategy it can be reasonable to override it with a different table, for example if only a single table is involved without any complex joins.
- Returns:
- the main table or null if not configured
-
getIdColumnName
String getIdColumnName()- Returns:
- id-column name for joining and the returned result, defaults to
SqlFormatConstants.DEFAULT_ID_COLUMN_NAME
-
getMainIdColumnName
Resolves the main id-column for joining further tables.The effective name of the ID-column can vary if the tables have custom-IDs and there are aliases or a renamed base selection.
This method simply tests if there is a main table (then the result is the column name) or not (then the ID isgetIdColumnName().Note: This is the raw name, of course finally the returned ID-column name is always
getIdColumnName()(renamed if required).- Returns:
- effective main id for joining
-
getAliasHelper
AliasHelper getAliasHelper()- Returns:
- the converter's alias helper to create and maintain aliases
-
getExpressionHelper
CoreExpressionSqlHelper getExpressionHelper()- Returns:
- the converter's expression helper to work with expressions and sub-expressions
-
getConditionFactory
MatchConditionFactory getConditionFactory()- Returns:
- the factory for creating match conditions on target columns, set by the converter per conversion run
-
getQueryType
QueryType getQueryType()- Returns:
- type of the query to be created, defaults to
QueryType.SELECT_DISTINCT_ID_ORDERED
-
getStyle
de.calamanari.adl.FormatStyle getStyle()- Returns:
- configured formatting style (inline or multi-line)
-
getWhereClause
StringBuilder getWhereClause()- Returns:
- WHERE-clause builder of the converter
-
getAliasesInWhereClause
Set<ExpressionAlias> getAliasesInWhereClause()- Returns:
- list of all aliases referenced in the where-clause, mutable
-
getTablesInWhereClause
Set<TableMetaInfo> getTablesInWhereClause()- Returns:
- list of all tables referenced in the where-clause, mutable
-