- All Implemented Interfaces:
ColumnExpression,DelegateExpression,SelectExpression
SUBSTRING(column, start, length) scalar function.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final @Nullable Integerprotected final intDatabase index, 1-based.Fields inherited from class org.litebridgedb.db.spi.impl.function.AliasedDelegateColumnExpression
columnIdentifierGeneratorFields inherited from class org.litebridgedb.db.spi.expression.DelegateColumnExpression
targetFields inherited from class org.litebridgedb.db.spi.expression.ColumnExpressionImpl
column -
Constructor Summary
ConstructorsConstructorDescriptionSubstring(ColumnExpression target, int start, @Nullable Integer length, ColumnIdentifierGenerator columnIdentifierGenerator) Construct aSUBSTRINGfunction. -
Method Summary
Methods inherited from class org.litebridgedb.db.spi.impl.function.FunctionExpression
prepareSql, toSql, toSqlWithAliasMethods inherited from class org.litebridgedb.db.spi.impl.function.AliasedDelegateColumnExpression
id, idWithAlias, localIdMethods inherited from class org.litebridgedb.db.spi.expression.DelegateColumnExpression
column, target
-
Field Details
-
start
protected final int startDatabase index, 1-based. -
length
-
-
Constructor Details
-
Substring
public Substring(ColumnExpression target, int start, @Nullable Integer length, ColumnIdentifierGenerator columnIdentifierGenerator) Construct aSUBSTRINGfunction.- Parameters:
target- Target expression to extract characters from.start- The starting position. The first character of a database string is always 1.length- The number of characters to return. Ifnull, the function extracts everything from the start position to the end of the text.columnIdentifierGenerator- Database provider-specific column identifier generator.
-
-
Method Details
-
template
Description copied from class:FunctionExpressionGets the template for the SQL representation of the function.The template should contain a single "%s" placeholder for the column identifier.
- Specified by:
templatein classFunctionExpression- Returns:
- SQL representation template
-