- All Implemented Interfaces:
ColumnExpression,DelegateExpression,SelectExpression
SUBSTRING(column, start, length) scalar function.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final @Nullable IntegerThe number of characters to return.protected final intDatabase index, 1-based.Fields inherited from class org.litebridge.db.spi.impl.function.DelegateColumnExpressionImpl
columnIdentifierGeneratorFields inherited from class org.litebridge.db.spi.expression.DelegateColumnExpression
targetFields inherited from class org.litebridge.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.litebridge.db.spi.impl.function.FunctionExpression
toSqlMethods inherited from class org.litebridge.db.spi.expression.DelegateColumnExpression
column, targetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.litebridge.db.spi.expression.SelectExpression
toSql
-
Field Details
-
start
protected final int startDatabase index, 1-based. -
length
The number of characters to return.
-
-
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
-