This class is a collection of static functions to create different types of select expressions within a database query. This includes selecting DTO fields, database expressions, or counting rows in a query.
This class cannot be instantiated.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ProtoNestableTOExpr<Number> ABS(): Absolute value of a number.static ProtoNestableTOExpr<Number> abs(ExpressionSpec expressionSpec) ABS(): Absolute value of a number.static TypeOverrideExpressionSpec<Number> AVG(): Returns the average value of a column/field.static TypeOverrideExpressionSpec<Number> avg(ExpressionSpec expressionSpec) AVG(): Returns the average value of a column/field.static ExpressionSpecSelects a database column by name.static ExpressionSpecSelects a database column by name.static ExpressionSpecSelects a database column by name.static ExpressionSpecSelects a database column by name and alias.static ExpressionSpecSelects a database column by name and alias.static ExpressionSpecSelects a database column by name and alias.static ExpressionSpecSelects a database column by name.static ExpressionSpecSelects a database column by name.static ExpressionSpecSelects a database column by name.static ExpressionSpeccolumnAlias(String column, @Nullable String alias) Selects a database column by name and alias.static ExpressionSpeccolumnAlias(String table, String column, @Nullable String columnAlias) Selects a database column by name and alias.static ExpressionSpeccolumnAlias(Table table, String column, @Nullable String columnAlias) Selects a database column by name and alias.static <T> ConvertIntent<T> convert(Class<T> returnType, ExpressionSpec... expressions) static <T> ConvertSpec<T> convert(ExpressionSpec expression, Class<T> returnType) Converts a database result into the specified Java type.static TypeOverrideExpressionSpec<Long> count()COUNT(): Selects the count of rows matching the query.static CurrentTimestampSpecstatic ExpressionSpecSelects a DTO field by name for the specified DTO type that is selected/joined in the query.static ExpressionSpecSelects a DTO field by name for the DTO class selected in the query.static ExpressionSpecSelects a DTO field by name for the specified DTO type that is selected/joined in the query.static ExpressionSpecSelects a DTO field by name for the DTO class selected in the query.static ProtoNestableTOExpr<String> LOWER(): Returns the lowercase value of a column's text.static ProtoNestableTOExpr<String> lower(ExpressionSpec expressionSpec) LOWER(): Returns the lowercase value of a column's text.static TypeOverrideExpressionSpec<Number> MAX(): Returns the highest or largest value within a specified column/field.static TypeOverrideExpressionSpec<Number> max(ExpressionSpec expressionSpec) MAX(): Returns the highest or largest value within a specified expression.static TypeOverrideExpressionSpec<Number> MIN(): Returns the lowest or smallest value within a specified column or expressionstatic TypeOverrideExpressionSpec<Number> min(ExpressionSpec expressionSpec) MIN(): Returns the lowest or smallest value within a specified column or expressionstatic ConvertIntent<Row> row(ExpressionSpec... expressions) static ProtoNestableTOExpr<String> SUBSTRING(): Returns the lowercase value of a column's text.static ProtoNestableTOExpr<String> SUBSTRING(): Returns the lowercase value of a column's text.static ProtoNestableTOExpr<String> substring(ExpressionSpec expressionSpec, int start) SUBSTRING(): Returns the lowercase value of a column's text.static ProtoNestableTOExpr<String> substring(ExpressionSpec expressionSpec, int start, int length) SUBSTRING(): Returns the lowercase value of a column's text.static ProtoNestableTOExpr<String> UPPER(): Returns the uppercase value of a column's text.static ProtoNestableTOExpr<String> upper(ExpressionSpec expressionSpec) UPPER(): Returns the uppercase value of a column's text.
-
Method Details
-
f
Selects a DTO field by name for the DTO class selected in the query.Shorthand for
field(String).- Parameters:
field- The name of the DTO field to select.- Returns:
- a
SelectFieldSpecexpression instance to select the specified field.
-
f
Selects a DTO field by name for the specified DTO type that is selected/joined in the query.Shorthand for
field(Class, String).- Parameters:
field- The name of the DTO field to select.- Returns:
- a
SelectFieldSpecexpression instance to select the specified field.
-
field
Selects a DTO field by name for the DTO class selected in the query.- Parameters:
field- The name of the DTO field to select.- Returns:
- a
SelectFieldSpecexpression instance to select the specified field.
-
field
Selects a DTO field by name for the specified DTO type that is selected/joined in the query.- Parameters:
field- The name of the DTO field to select.- Returns:
- a
SelectFieldSpecexpression instance to select the specified field.
-
c
Selects a database column by name.This is shorthand for
column(String).The returned
ProtoColumnExpressionSpecvalue has no context of the table it is selecting from yet.- Parameters:
column- The name of the column to select.- Returns:
- a
ProtoColumnExpressionSpecexpression instance to select a specific column.
-
column
Selects a database column by name.The returned
ProtoColumnExpressionSpecvalue has no context of the table it is selecting from yet.- Parameters:
column- The name of the column to select.- Returns:
- a
ProtoColumnExpressionSpecexpression instance to select a specific column.
-
c
Selects a database column by name.Shorthand for
column(String, String)The returned
ProtoColumnExpressionSpecvalue has no context of the table it is selecting from yet.- Parameters:
table- The table to select the column from.column- The name of the column to select.- Returns:
- a
ProtoColumnExpressionSpecexpression instance to select a specific column.
-
column
Selects a database column by name.The returned
ProtoColumnExpressionSpecvalue has no context of the table it is selecting from yet.- Parameters:
table- The table to select the column from.column- The name of the column to select.- Returns:
- a
ProtoColumnExpressionSpecexpression instance to select a specific column.
-
c
Selects a database column by name.Shorthand for
column(Table, String)The returned
ProtoColumnExpressionSpecvalue has no context of the table it is selecting from yet.- Parameters:
table- The table to select the column from.column- The name of the column to select.- Returns:
- a
ProtoColumnExpressionSpecexpression instance to select a specific column.
-
column
Selects a database column by name.The returned
ProtoColumnExpressionSpecvalue has no context of the table it is selecting from yet.- Parameters:
table- The table to select the column from.column- The name of the column to select.- Returns:
- a
ProtoColumnExpressionSpecexpression instance to select a specific column.
-
ca
Selects a database column by name and alias.Shorthand for
columnAlias(Table, String, String)(Table, String, String)}The returned
ProtoColumnExpressionSpecvalue has no context of the table it is selecting from yet.- Parameters:
table- The table to select the column from.column- The name of the column to select.columnAlias- The alias to use for the column; may benull.- Returns:
- a
ProtoColumnExpressionSpecexpression instance to select a specific column.
-
columnAlias
Selects a database column by name and alias.The returned
ProtoColumnExpressionSpecvalue has no context of the table it is selecting from yet.- Parameters:
table- The table to select the column from.column- The name of the column to select.columnAlias- The alias to use for the column; may benull.- Returns:
- a
ProtoColumnExpressionSpecexpression instance to select a specific column.
-
ca
Selects a database column by name and alias.Shorthand for
columnAlias(String, String)The returned
ProtoColumnExpressionSpecvalue has no context of the table it is selecting from yet.- Parameters:
column- The name of the column to select.alias- The alias to use for the column.- Returns:
- a
ProtoColumnExpressionSpecexpression instance to select a specific column.
-
columnAlias
Selects a database column by name and alias.The returned
ProtoColumnExpressionSpecvalue has no context of the table it is selecting from yet.- Parameters:
column- The name of the column to select.alias- The alias to use for the column.- Returns:
- a
ProtoColumnExpressionSpecexpression instance to select a specific column.
-
ca
Selects a database column by name and alias.Shorthand for
columnAlias(Table, String, String)The returned
ProtoColumnExpressionSpecvalue has no context of the table it is selecting from yet.- Parameters:
table- The table to select the column from.column- The name of the column to select.columnAlias- The alias to use for the column.- Returns:
- a
ProtoColumnExpressionSpecexpression instance to select a specific column.
-
columnAlias
Selects a database column by name and alias.The returned
ProtoColumnExpressionSpecvalue has no context of the table it is selecting from yet.- Parameters:
table- The table to select the column from.column- The name of the column to select.columnAlias- The alias to use for the column.- Returns:
- a
ProtoColumnExpressionSpecexpression instance to select a specific column.
-
convert
Converts a database result into the specified Java type.This uses Litebridge's registered type converter to perform the conversion; it is not a database operation.
It can be used to ensure that the return value of a nested expression is converted to the specified Java type on the ORM side; e.g.
avg(ExpressionSpec)returns a @{Number} instance by default, with the actual return type being determined by the database. To convert the return type to aLong,convert()can be used to convert it before returning:litebridge.select(Fn.convert(Fn.avg(column), Long.class));- Parameters:
expression- The target expression result to convertreturnType- The type to convert the expression result to- Returns:
- a
ProtoColumnExpressionSpecexpression instance to convert the return value of the nested expression
-
convert
-
row
-
avg
AVG(): Returns the average value of a column/field.- Parameters:
column- Name of the target column/field to calculate the average value of.- Returns:
- a
ProtoNestableTOExprexpression instance to select the average value of a column/field.
-
avg
AVG(): Returns the average value of a column/field.- Parameters:
expressionSpec- Target nested expression to calculate the average value of.- Returns:
- a
ProtoNestableTOExprexpression instance to select the average value of a column/field.
-
max
MAX(): Returns the highest or largest value within a specified column/field.- Parameters:
column- Name of the target column/field to calculate the maximum value of.- Returns:
- a
ProtoNestableTOExprexpression instance to select the maximum value of a column/field.
-
max
MAX(): Returns the highest or largest value within a specified expression.- Parameters:
expressionSpec- Target nested expression to calculate the maximum value of.- Returns:
- a
ProtoNestableTOExprexpression instance to select the maximum value of a column/field.
-
min
MIN(): Returns the lowest or smallest value within a specified column or expression- Parameters:
column- Name of the target column/field to calculate the maximum value of.- Returns:
- a
ProtoNestableTOExprexpression instance to select the maximum value of a column/field.
-
min
MIN(): Returns the lowest or smallest value within a specified column or expression- Parameters:
expressionSpec- Target nested expression to calculate the maximum value of.- Returns:
- a
ProtoNestableTOExprexpression instance to select the maximum value of a column/field.
-
count
COUNT(): Selects the count of rows matching the query.- Returns:
- a
CountSpecexpression instance to select the count of rows.
-
upper
UPPER(): Returns the uppercase value of a column's text.- Parameters:
column- Target column/field name- Returns:
- a
ProtoNestableTOExprexpression instance to select a specific column.
-
upper
UPPER(): Returns the uppercase value of a column's text.- Parameters:
expressionSpec- Target nested expression- Returns:
- a
ProtoNestableTOExprexpression instance to select a specific column.
-
lower
LOWER(): Returns the lowercase value of a column's text.- Parameters:
column- Target column/field name- Returns:
- a
ProtoNestableTOExprexpression instance to select a specific column.
-
lower
LOWER(): Returns the lowercase value of a column's text.- Parameters:
expressionSpec- Target nested expression- Returns:
- a
ProtoNestableTOExprexpression instance to select a specific column.
-
substring
SUBSTRING(): Returns the lowercase value of a column's text.This shorthand version omits the "length" parameter and thus extracts everything from the start position to the end of the text.
- Parameters:
column- Target column to extract characters from.start- The starting position. The first character of a database string is always 1.- Returns:
- a
ProtoNestableTOExprexpression instance to select a specific column. - See Also:
-
substring
SUBSTRING(): Returns the lowercase value of a column's text.This shorthand version omits the "length" parameter and thus extracts everything from the start position to the end of the text.
- Parameters:
expressionSpec- Target nested expression to extract characters from.start- The starting position. The first character of a database string is always 1.- Returns:
- a
ProtoNestableTOExprexpression instance to select a specific column. - See Also:
-
substring
SUBSTRING(): Returns the lowercase value of a column's text.- Parameters:
column- Target column 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.- Returns:
- a
ProtoNestableTOExprexpression instance to select a specific column. - See Also:
-
substring
public static ProtoNestableTOExpr<String> substring(ExpressionSpec expressionSpec, int start, int length) SUBSTRING(): Returns the lowercase value of a column's text.- Parameters:
expressionSpec- Target nested 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.- Returns:
- a
ProtoNestableTOExprexpression instance to select a specific column. - See Also:
-
abs
ABS(): Absolute value of a number.- Parameters:
column- Target column/field.- Returns:
- a
ProtoNestableTOExprexpression instance to select a specific column.
-
abs
ABS(): Absolute value of a number.- Parameters:
expressionSpec- Target nested expression.- Returns:
- a
ProtoNestableTOExprexpression instance to select a specific column.
-
currentTimestamp
-