Module litebridge.db.spi.impl
Class Substring
java.lang.Object
org.litebridge.db.spi.impl.expression.AbstractExpression
org.litebridge.db.spi.impl.expression.AbstractAliasedExpression
org.litebridge.db.spi.impl.expression.function.FunctionExpression
org.litebridge.db.spi.impl.expression.function.scalar.Substring
- All Implemented Interfaces:
AliasedExpression,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.expression.AbstractAliasedExpression
alias, tableAliasFields inherited from class org.litebridge.db.spi.impl.expression.AbstractExpression
labelGenerator -
Constructor Summary
ConstructorsConstructorDescriptionSubstring(SelectExpression target, int start, @Nullable Integer length, @Nullable String alias, LabelGenerator labelGenerator) Construct aSUBSTRINGfunction. -
Method Summary
Methods inherited from class org.litebridge.db.spi.impl.expression.function.FunctionExpression
target, toSqlMethods inherited from class org.litebridge.db.spi.impl.expression.AbstractAliasedExpression
addAliasAs, alias, equals, hashCode, tableAlias, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, 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(SelectExpression target, int start, @Nullable Integer length, @Nullable String alias, LabelGenerator labelGenerator) 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.alias- The alias for the column expression.labelGenerator- the label generator for rendering aliases/identifiers
-
-
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
-