|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jooq.impl.CustomField<T>
public abstract class CustomField<T>
A base class for custom Field
implementations in client code.
Client code may provide proper Field
implementations extending this
useful base class. All necessary parts of the Field
interface are
already implemented. Only these two methods need further implementation:
Constructor Summary | |
---|---|
protected |
CustomField(String name,
DataType<T> type)
|
Method Summary | |||
---|---|---|---|
Field<T> |
abs()
Get the absolute value of a numeric field: abs(field) This renders the same on all dialects: abs([this]) |
||
Field<BigDecimal> |
acos()
Get the arc cosine(field) function This renders the acos function where available: acos([this]) |
||
Field<T> |
add(Field<? extends Number> value)
Don't allow any further overrides |
||
Field<T> |
add(Number value)
An arithmetic expression adding this to value. |
||
Field<T> |
as(String alias)
Don't allow any further overrides |
||
SortField<T> |
asc()
Create an ascending sort field from this field |
||
Field<Integer> |
ascii()
Get the ascii(field) function This renders the replace or str_replace function: ascii([this]) |
||
Field<BigDecimal> |
asin()
Get the arc sine(field) function This renders the asin function where available: asin([this]) |
||
Field<BigDecimal> |
atan()
Get the arc tangent(field) function This renders the atan function where available: atan([this]) |
||
Field<BigDecimal> |
atan2(Field<? extends Number> y)
Get the arc tangent 2(field, y) function This renders the atan2 or atn2 function where available: atan2([this]) or
atn2([this]) |
||
Field<BigDecimal> |
atan2(Number y)
Get the arc tangent 2(field, y) function This renders the atan2 or atn2 function where available: atan2([this]) or
atn2([this]) |
||
void |
attach(Configuration configuration)
By default, nothing is done on an attachment event. |
||
Field<BigDecimal> |
avg()
Get the average over a numeric field: avg(field) |
||
WindowPartitionByStep<BigDecimal> |
avgOver()
The avg(field) over ([analytic clause]) function. |
||
Condition |
between(Field<T> minValue,
Field<T> maxValue)
this between minValue and maxValue |
||
Condition |
between(T minValue,
T maxValue)
this between minValue and maxValue |
||
abstract void |
bind(BindContext context)
Bind all parameters of this QueryPart to a PreparedStatement This method is for JOOQ INTERNAL USE only. |
||
int |
bind(Configuration configuration,
PreparedStatement stmt)
Deprecated. |
||
int |
bind(Configuration configuration,
PreparedStatement stmt,
int initialIndex)
Deprecated. |
||
int |
bindDeclaration(Configuration configuration,
PreparedStatement stmt)
Deprecated. |
||
int |
bindDeclaration(Configuration configuration,
PreparedStatement stmt,
int initialIndex)
Deprecated. |
||
int |
bindReference(Configuration configuration,
PreparedStatement stmt)
Deprecated. |
||
int |
bindReference(Configuration configuration,
PreparedStatement stmt,
int initialIndex)
Deprecated. |
||
Field<Integer> |
bitLength()
Get the bit_length(field) function This translates into any dialect |
||
|
cast(Class<? extends Z> type)
Cast this field to another type The actual cast may not be accurate as the DataType has to be
"guessed" from the jOOQ-configured data types. |
||
|
cast(DataType<Z> type)
Cast this field to a dialect-specific data type. |
||
|
cast(Field<Z> field)
Cast this field to the type of another field. |
||
Field<T> |
ceil()
Get the smallest integer value not less than [this] This renders the ceil or ceiling function where available: ceil([this]) or
ceiling([this])
... or simulates it elsewhere using round:
round([this] + 0.499999999999999) |
||
Field<Integer> |
charLength()
Get the char_length(field) function This translates into any dialect |
||
Field<T> |
coalesce(Field<T> option,
Field<?>... options)
Gets the Oracle-style COALESCE(expr1, expr2, ... , exprn)
function
Returns the dialect's equivalent to COALESCE:
Oracle COALESCE
|
||
Field<T> |
coalesce(T option,
T... options)
Gets the Oracle-style COALESCE(expr1, expr2, ... , exprn)
function |
||
int |
compareTo(NamedQueryPart that)
|
||
Field<String> |
concat(Field<?>... fields)
This default implementation is known to be overridden by Expression to generate neater expressions |
||
Field<String> |
concat(String... values)
Get the concat(value[, value, ...]) function This creates this || fields[0] || fields[1] || ... |
||
Field<BigDecimal> |
cos()
Get the cosine(field) function This renders the cos function where available: cos([this]) |
||
Field<BigDecimal> |
cosh()
Get the hyperbolic cosine function: cosh(field) This renders the cosh function where available: cosh([this]) ... or simulates it elsewhere using
exp: (exp([this] * 2) + 1) / (exp([this] * 2)) |
||
Field<BigDecimal> |
cot()
Get the cotangent(field) function This renders the cot function where available: cot([this]) ... or simulates it elsewhere using
sin and cos: cos([this]) / sin([this]) |
||
Field<BigDecimal> |
coth()
Get the hyperbolic cotangent function: coth(field) This is not supported by any RDBMS, but simulated using exp exp: (exp([this] * 2) + 1) / (exp([this] * 2) - 1) |
||
Field<Integer> |
count()
Get the count(field) function |
||
Field<Integer> |
countDistinct()
Get the count(distinct field) function |
||
WindowPartitionByStep<Integer> |
countOver()
The count(field) over ([analytic clause]) function. |
||
protected Factory |
create()
Internal convenience method |
||
protected Factory |
create(Configuration configuration)
Internal convenience method |
||
boolean |
declaresFields()
Subclasses may override this |
||
boolean |
declaresTables()
Subclasses may override this |
||
|
decode(Field<T> search,
Field<Z> result)
Gets the Oracle-style DECODE(expression, search, result[, search , result]... [, default])
function |
||
|
decode(Field<T> search,
Field<Z> result,
Field<?>... more)
Gets the Oracle-style DECODE(expression, search, result[, search , result]... [, default])
function
Returns the dialect's equivalent to DECODE:
Oracle DECODE
Other dialects:
CASE WHEN [this = search] THEN [result],
[WHEN more... |
||
|
decode(T search,
Z result)
Gets the Oracle-style DECODE(expression, search, result[, search , result]... [, default])
function |
||
|
decode(T search,
Z result,
Object... more)
Gets the Oracle-style DECODE(expression, search, result[, search , result]... [, default])
function |
||
Field<BigDecimal> |
deg()
Calculate degrees from radians from this field This renders the degrees function where available: degrees([this]) ... or simulates it elsewhere:
[this] * 180 / PI |
||
SortField<T> |
desc()
Create a descending sort field from this field |
||
Field<T> |
div(Field<? extends Number> value)
An arithmetic expression dividing this by value |
||
Field<T> |
div(Number value)
An arithmetic expression dividing this by value |
||
Condition |
equal(Field<T> field)
this = field |
||
Condition |
equal(Select<?> query)
this = (Select |
||
Condition |
equal(T value)
this = value |
||
Condition |
equalAll(Select<?> query)
this = all (Select |
||
Condition |
equalAny(Select<?> query)
this = any (Select |
||
boolean |
equals(Object that)
|
||
Condition |
equalSome(Select<?> query)
this = some (Select |
||
Field<BigDecimal> |
exp()
Get the exp(field) function, taking this field as the power of e This renders the same on all dialects: exp([this]) |
||
Field<Integer> |
extract(DatePart datePart)
Get the extract(field, datePart) function This translates into any dialect |
||
org.jooq.impl.WindowFunction<T> |
firstValue()
The first_value(field) over ([analytic clause]) function. |
||
Field<T> |
floor()
Get the largest integer value not greater than [this] This renders the floor function where available: floor([this])
... or simulates it elsewhere using round:
round([this] - 0.499999999999999) |
||
List<Attachable> |
getAttachables()
Subclasses may further override this method Get the list of dependent Attachables
This method is for JOOQ INTERNAL USE only. |
||
protected List<Attachable> |
getAttachables(Collection<? extends QueryPart> list)
Internal convenience method |
||
protected List<Attachable> |
getAttachables(QueryPart... list)
Internal convenience method |
||
protected List<Attachable> |
getAttachables(Store<?> store)
Internal convenience method |
||
List<Object> |
getBindValues()
Retrieve the bind values that will be bound by this QueryPart This method is exposed publicly in Query.getBindValues() |
||
String |
getCastTypeName()
Deprecated. |
||
Configuration |
getConfiguration()
Get the underlying configuration |
||
DataType<T> |
getDataType()
The type of this object (might not be dialect-specific) |
||
DataType<T> |
getDataType(Configuration configuration)
The dialect-specific type of this object |
||
SQLDialect |
getDialect()
Reproduce the SQL dialect this QueryPart was created with This method is for JOOQ INTERNAL USE only. |
||
String |
getName()
The name of this query part |
||
String |
getSQL()
Retrieve the SQL code rendered by this query part. |
||
protected SQLDataType<T> |
getSQLDataType()
|
||
Class<? extends T> |
getType()
The type of this object |
||
String |
getTypeName()
Deprecated. |
||
Condition |
greaterOrEqual(Field<T> field)
this >= field |
||
Condition |
greaterOrEqual(Select<?> query)
this >= (Select |
||
Condition |
greaterOrEqual(T value)
this >= value |
||
Condition |
greaterOrEqualAll(Select<?> query)
this >= all (Select |
||
Condition |
greaterOrEqualAny(Select<?> query)
this >= any (Select |
||
Condition |
greaterOrEqualSome(Select<?> query)
this >= some (Select |
||
Condition |
greaterThan(Field<T> field)
this > field |
||
Condition |
greaterThan(Select<?> query)
this > (Select |
||
Condition |
greaterThan(T value)
this > value |
||
Condition |
greaterThanAll(Select<?> query)
this > all (Select |
||
Condition |
greaterThanAny(Select<?> query)
this > any (Select |
||
Condition |
greaterThanSome(Select<?> query)
this > some (Select |
||
Field<T> |
greatest(Field<?>... others)
Find the greatest among all values This function has no equivalent in Adaptive Server, Derby, SQL Server and Sybase SQL Anywhere. |
||
Field<T> |
greatest(T... others)
Find the greatest among all values This function has no equivalent in Adaptive Server, Derby, SQL Server and Sybase SQL Anywhere. |
||
int |
hashCode()
|
||
Condition |
in(Collection<T> values)
this in (values...) |
||
Condition |
in(Field<?>... values)
this in (values...) |
||
Condition |
in(Select<?> query)
this in (select...) |
||
Condition |
in(T... values)
this in (values...) |
||
protected AttachableInternal |
internal(Attachable part)
Internal convenience method |
||
protected QueryPartInternal |
internal(QueryPart part)
Internal convenience method |
||
|
internalAPI(Class<I> internalType)
Adapt to an internal type assuming its functionality This is for JOOQ INTERNAL USE only. |
||
Condition |
isFalse()
lcase(this) in ("0", "n", "no", "false", "off", "disabled") |
||
Condition |
isNotNull()
this is not null |
||
Condition |
isNull()
this is null |
||
boolean |
isNullLiteral()
Subclasses may further override this method Whether this field represents a null literal. |
||
Condition |
isTrue()
lcase(this) in ("1", "y", "yes", "true", "on", "enabled") |
||
org.jooq.impl.WindowFunction<T> |
lag()
The lag(field) over ([analytic clause]) function. |
||
org.jooq.impl.WindowFunction<T> |
lag(int offset)
The lag(field, offset) over ([analytic clause]) function. |
||
org.jooq.impl.WindowFunction<T> |
lag(int offset,
Field<T> defaultValue)
The lag(field, offset, defaultValue) over ([analytic clause])
function. |
||
org.jooq.impl.WindowFunction<T> |
lag(int offset,
T defaultValue)
The lag(field, offset, defaultValue) over ([analytic clause])
function. |
||
org.jooq.impl.WindowFunction<T> |
lastValue()
The last_value(field) over ([analytic clause]) function. |
||
org.jooq.impl.WindowFunction<T> |
lead()
The lead(field) over ([analytic clause]) function. |
||
org.jooq.impl.WindowFunction<T> |
lead(int offset)
The lead(field, offset) over ([analytic clause]) function. |
||
org.jooq.impl.WindowFunction<T> |
lead(int offset,
Field<T> defaultValue)
The lead(field, offset, defaultValue) over ([analytic clause])
function. |
||
org.jooq.impl.WindowFunction<T> |
lead(int offset,
T defaultValue)
The lead(field, offset, defaultValue) over ([analytic clause])
function. |
||
Field<T> |
least(Field<?>... others)
Find the least among all values This function has no equivalent in Adaptive Server, Derby, SQL Server and Sybase SQL Anywhere. |
||
Field<T> |
least(T... others)
Find the least among all values This function has no equivalent in Adaptive Server, Derby, SQL Server and Sybase SQL Anywhere. |
||
Field<Integer> |
length()
Get the length of a VARCHAR type. |
||
Condition |
lessOrEqual(Field<T> field)
this <= field |
||
Condition |
lessOrEqual(Select<?> query)
this <= (Select |
||
Condition |
lessOrEqual(T value)
this <= value |
||
Condition |
lessOrEqualAll(Select<?> query)
this <= all (Select |
||
Condition |
lessOrEqualAny(Select<?> query)
this <= any (Select |
||
Condition |
lessOrEqualSome(Select<?> query)
this <= some (Select |
||
Condition |
lessOrEqualToAll(Select<?> query)
Deprecated. |
||
Condition |
lessOrEqualToAny(Select<?> query)
Deprecated. |
||
Condition |
lessOrEqualToSome(Select<?> query)
Deprecated. |
||
Condition |
lessThan(Field<T> field)
this < field |
||
Condition |
lessThan(Select<?> query)
this < (Select |
||
Condition |
lessThan(T value)
this < value |
||
Condition |
lessThanAll(Select<?> query)
this < all (Select |
||
Condition |
lessThanAny(Select<?> query)
this < any (Select |
||
Condition |
lessThanSome(Select<?> query)
this < some (Select |
||
Condition |
like(T value)
this like value |
||
Field<BigDecimal> |
ln()
Get the ln(field) function, taking the natural logarithm of this field This renders the ln or log function where available: ln([this]) or
log([this]) |
||
Field<BigDecimal> |
log(int base)
Get the log(field, base) function This renders the log function where available: log([this]) ... or simulates it elsewhere (in
most RDBMS) using the natural logarithm:
ln([this]) / ln([base]) |
||
Field<String> |
lower()
Get the lower(field) function This renders the lower function in all dialects: lower([this]) |
||
Field<String> |
lpad(Field<? extends Number> length)
Get the lpad(field, length) function This renders the lpad function where available: lpad([this], [length]) ... or simulates it
elsewhere using concat, repeat, and length, which may be simulated as
well, depending on the RDBMS:
concat(repeat(' ', [length] - length([this])), [this]) |
||
Field<String> |
lpad(Field<? extends Number> length,
Field<String> c)
Get the lpad(field, length, character) function This renders the lpad function where available: lpad([this], [length]) ... or simulates it
elsewhere using concat, repeat, and length, which may be simulated as
well, depending on the RDBMS:
concat(repeat([character], [length] - length([this])), [this]) |
||
Field<String> |
lpad(int length)
Get the lpad(field, length) function This renders the lpad function where available: lpad([this], [length]) ... or simulates it
elsewhere using concat, repeat, and length, which may be simulated as
well, depending on the RDBMS:
concat(repeat(' ', [length] - length([this])), [this]) |
||
Field<String> |
lpad(int length,
char c)
Get the lpad(field, length, character) function This renders the lpad function where available: lpad([this], [length]) ... or simulates it
elsewhere using concat, repeat, and length, which may be simulated as
well, depending on the RDBMS:
concat(repeat([character], [length] - length([this])), [this]) |
||
Field<String> |
ltrim()
Get the ltrim(field) function This renders the ltrim function in all dialects: ltrim([this]) |
||
Field<T> |
max()
Get the max value over a field: max(field) |
||
WindowPartitionByStep<T> |
maxOver()
The max(field) over ([analytic clause]) function. |
||
Field<BigDecimal> |
median()
Get the median over a numeric field: median(field) This is known to be supported in any of these RDBMS: HSQLDB Oracle Sybase SQL Anywhere |
||
Field<T> |
min()
Get the min value over a field: min(field) |
||
WindowPartitionByStep<T> |
minOver()
The min(field) over ([analytic clause]) function. |
||
Field<T> |
mod(Field<? extends Number> value)
An arithmetic expression getting the modulo of this divided by value This renders the modulo operation where available: [this] % [value]
... or the modulo function elsewhere:
mod([this], [value]) |
||
Field<T> |
mod(Number value)
An arithmetic expression getting the modulo of this divided by value This renders the modulo operation where available: [this] % [value]
... or the modulo function elsewhere:
mod([this], [value]) |
||
Field<T> |
mul(Field<? extends Number> value)
Don't allow any further overrides |
||
Field<T> |
mul(Number value)
An arithmetic expression multiplying this with value |
||
Field<T> |
neg()
Negate this field to get its negative value. |
||
Condition |
notEqual(Field<T> field)
this ! |
||
Condition |
notEqual(Select<?> query)
this ! |
||
Condition |
notEqual(T value)
this ! |
||
Condition |
notEqualAll(Select<?> query)
this ! |
||
Condition |
notEqualAny(Select<?> query)
this ! |
||
Condition |
notEqualSome(Select<?> query)
this ! |
||
Condition |
notIn(Collection<T> values)
this not in (values...) |
||
Condition |
notIn(Field<?>... values)
this not in (values...) |
||
Condition |
notIn(Select<?> query)
this not in (select...) |
||
Condition |
notIn(T... values)
this not in (values...) |
||
Condition |
notLike(T value)
this not like value |
||
Field<T> |
nullif(Field<T> other)
Gets the Oracle-style NULLIF(value, other) function Returns the dialect's equivalent to NULLIF: Oracle NULLIF |
||
Field<T> |
nullif(T other)
Gets the Oracle-style NULLIF(value, other) function |
||
Field<T> |
nvl(Field<T> defaultValue)
Gets the Oracle-style NVL(value, defaultValue) function Returns the dialect's equivalent to NVL: DB2 |
Field<T> |
nvl(T defaultValue)
Gets the Oracle-style NVL(value, defaultValue) function |
|
nvl2(Field<Z> valueIfNotNull,
Field<Z> valueIfNull)
Gets the Oracle-style NVL2(value, valueIfNotNull, valueIfNull) function Returns the dialect's equivalent to NVL2: Oracle NVL2 Other dialects: CASE WHEN [value] IS NULL THEN [valueIfNull] ELSE [valueIfNotNull] END |
||
|
nvl2(Z valueIfNotNull,
Z valueIfNull)
Gets the Oracle-style NVL2(value, valueIfNotNull, valueIfNull) function |
||
Field<Integer> |
octetLength()
Get the octet_length(field) function This translates into any dialect |
||
Field<Integer> |
position(Field<String> search)
Get the position(in, search) function This renders the position or any equivalent function: position([search] in [this]) or
locate([this], [search]) or
locate([search], [this]) or
instr([this], [search]) or
charindex([search], [this]) |
||
Field<Integer> |
position(String search)
Get the position(in, search) function This renders the position or any equivalent function: position([search] in [this]) or
locate([this], [search]) or
locate([search], [this]) or
instr([this], [search]) or
charindex([search], [this]) |
||
Field<BigDecimal> |
power(Number exponent)
Get the power(field, exponent) function This renders the power function where available: power([this], [exponent]) ... or simulates it
elsewhere using ln and exp:
exp(ln([this]) * [exponent]) |
||
Field<BigDecimal> |
rad()
Calculate radians from degrees from this field This renders the degrees function where available: degrees([this]) ... or simulates it elsewhere:
[this] * PI / 180 |
||
Field<String> |
repeat(Field<? extends Number> count)
Get the repeat(field, count) function This renders the repeat or replicate function where available: repeat([this], [count]) or
replicate([this], [count]) ... or simulates it elsewhere
using rpad and length, which may be simulated as well, depending on the
RDBMS:
rpad([this], length([this]) * [count], [this]) |
||
Field<String> |
repeat(Number count)
Get the repeat(count) function This renders the repeat or replicate function where available: repeat([this], [count]) or
replicate([this], [count]) ... or simulates it elsewhere
using rpad and length, which may be simulated as well, depending on the
RDBMS:
rpad([this], length([this]) * [count], [this]) |
||
Field<String> |
replace(Field<String> search)
Get the replace(in, search) function This renders the replace or str_replace function where available: replace([this], [search]) or
str_replace([this], [search]) ... or simulates it elsewhere
using the three-argument replace function:
replace([this], [search], '') |
||
Field<String> |
replace(Field<String> search,
Field<String> replace)
Get the replace(in, search, replace) function This renders the replace or str_replace function: replace([this], [search]) or
str_replace([this], [search]) |
||
Field<String> |
replace(String search)
Get the replace(in, search) function This renders the replace or str_replace function where available: replace([this], [search]) or
str_replace([this], [search]) ... or simulates it elsewhere
using the three-argument replace function:
replace([this], [search], '') |
||
Field<String> |
replace(String search,
String replace)
Get the replace(in, search, replace) function This renders the replace or str_replace function: replace([this], [search]) or
str_replace([this], [search]) |
||
Field<T> |
round()
Get rounded value of a numeric field: round(field) This renders the round function where available: round([this]) or
round([this], 0)
... or simulates it elsewhere using floor and ceil |
||
Field<T> |
round(int decimals)
Get rounded value of a numeric field: round(field, decimals) This renders the round function where available: round([this], [decimals])
... or simulates it elsewhere using floor and ceil |
||
Field<String> |
rpad(Field<? extends Number> length)
Get the rpad(field, length) function This renders the rpad function where available: rpad([this], [length]) ... or simulates it
elsewhere using concat, repeat, and length, which may be simulated as
well, depending on the RDBMS:
concat([this], repeat(' ', [length] - length([this]))) |
||
Field<String> |
rpad(Field<? extends Number> length,
Field<String> c)
Get the rpad(field, length, character) function This renders the rpad function where available: rpad([this], [length]) ... or simulates it
elsewhere using concat, repeat, and length, which may be simulated as
well, depending on the RDBMS:
concat([this], repeat([character], [length] - length([this]))) |
||
Field<String> |
rpad(int length)
Get the rpad(field, length) function This renders the rpad function where available: rpad([this], [length]) ... or simulates it
elsewhere using concat, repeat, and length, which may be simulated as
well, depending on the RDBMS:
concat([this], repeat(' ', [length] - length([this]))) |
||
Field<String> |
rpad(int length,
char c)
Get the rpad(field, length, character) function This renders the rpad function where available: rpad([this], [length]) ... or simulates it
elsewhere using concat, repeat, and length, which may be simulated as
well, depending on the RDBMS:
concat([this], repeat([character], [length] - length([this]))) |
||
Field<String> |
rtrim()
Get the rtrim(field) function This renders the rtrim function in all dialects: rtrim([this]) |
||
Field<Integer> |
sign()
Get the sign of a numeric field: sign(field) This renders the sign function where available: sign([this])
... or simulates it elsewhere (without bind variables on values -1, 0, 1):
CASE WHEN [this] > 0 THEN 1
WHEN [this] < 0 THEN -1
ELSE 0
END |
||
Field<BigDecimal> |
sin()
Get the sine(field) function This renders the sin function where available: sin([this]) |
||
Field<BigDecimal> |
sinh()
Get the hyperbolic sine function: sinh(field) This renders the sinh function where available: sinh([this]) ... or simulates it elsewhere using
exp: (exp([this] * 2) - 1) / (exp([this] * 2)) |
||
|
sort(Map<T,Z> sortMap)
Create a sort field of the form (in pseudo code)
CASE [this] WHEN [sortMap.key(0)] THEN sortMap.value(0)
WHEN [sortMap.key(1)] THEN sortMap.value(1)
... |
||
SortField<Integer> |
sortAsc(Collection<T> sortList)
Create a sort field of the form
CASE [this] WHEN [sortList.get(0)] THEN 0
WHEN [sortList.get(1)] THEN 1
... |
||
SortField<Integer> |
sortAsc(T... sortList)
Create a sort field of the form
CASE [this] WHEN [sortList[0]] THEN 0
WHEN [sortList[1]] THEN 1
... |
||
SortField<Integer> |
sortDesc(Collection<T> sortList)
Create a sort field of the form
CASE [this] WHEN [sortList.get(0)] THEN 0
WHEN [sortList.get(1)] THEN 1
... |
||
SortField<Integer> |
sortDesc(T... sortList)
Create a sort field of the form
CASE [this] WHEN [sortList[0]] THEN 0
WHEN [sortList[1]] THEN 1
... |
||
Field<BigDecimal> |
sqrt()
Get the sqrt(field) function This renders the sqrt function where available: sqrt([this]) ... or simulates it elsewhere using
power (which in turn may also be simulated using ln and exp functions):
power([this], 0.5) |
||
Field<BigDecimal> |
stddevPop()
Get the population standard deviation of a numeric field: stddev_pop(field) This is known to be supported in any of these RDBMS: DB2 H2 HSQLDB Ingres MySQL Oracle Postgres SQL Server (stdev) Sybase ASE Sybase SQL Anywhere |
||
WindowPartitionByStep<BigDecimal> |
stddevPopOver()
The stddev_pop(field) over ([analytic clause]) function. |
||
Field<BigDecimal> |
stddevSamp()
Get the sample standard deviation of a numeric field: stddev_samp(field) This is known to be supported in any of these RDBMS: DB2 H2 HSQLDB Ingres MySQL Oracle Postgres SQL Server (stdev) Sybase ASE Sybase SQL Anywhere |
||
WindowPartitionByStep<BigDecimal> |
stddevSampOver()
The stddev_samp(field) over ([analytic clause]) function. |
||
Field<T> |
sub(Field<? extends Number> value)
An arithmetic expression subtracting value from this |
||
Field<T> |
sub(Number value)
An arithmetic expression subtracting value from this. |
||
Field<String> |
substring(Field<? extends Number> startingPosition)
Get the substring(field, startingPosition) function This renders the substr or substring function: substr([this], [startingPosition]) or
substring([this], [startingPosition]) |
||
Field<String> |
substring(Field<? extends Number> startingPosition,
Field<? extends Number> length)
Get the substring(field, startingPosition, length) function This renders the substr or substring function: substr([this], [startingPosition], [length]) or
substring([this], [startingPosition], [length]) |
||
Field<String> |
substring(int startingPosition)
Get the substring(field, startingPosition) function This renders the substr or substring function: substr([this], [startingPosition]) or
substring([this], [startingPosition]) |
||
Field<String> |
substring(int startingPosition,
int length)
Get the substring(field, startingPosition, length) function This renders the substr or substring function: substr([this], [startingPosition], [length]) or
substring([this], [startingPosition], [length]) |
||
Field<BigDecimal> |
sum()
Get the sum over a numeric field: sum(field) |
||
WindowPartitionByStep<BigDecimal> |
sumOver()
The sum(field) over ([analytic clause]) function. |
||
Field<BigDecimal> |
tan()
Get the tangent(field) function This renders the tan function where available: tan([this]) |
||
Field<BigDecimal> |
tanh()
Get the hyperbolic tangent function: tanh(field) This renders the tanh function where available: tanh([this]) ... or simulates it elsewhere using
exp:
(exp([this] * 2) - 1) / (exp([this] * 2) + 1) |
||
abstract void |
toSQL(RenderContext context)
Render this QueryPart to a SQL string contained in
context.sql() . |
||
String |
toSQLDeclaration(Configuration configuration)
Deprecated. |
||
String |
toSQLDeclaration(Configuration configuration,
boolean inlineParameters)
Deprecated. |
||
String |
toSQLReference(Configuration configuration)
Deprecated. |
||
String |
toSQLReference(Configuration configuration,
boolean inlineParameters)
Deprecated. |
||
String |
toString()
|
||
Field<String> |
trim()
Get the trim(field) function This renders the trim function where available: trim([this]) ... or simulates it elsewhere using
rtrim and ltrim: ltrim(rtrim([this])) |
||
Field<String> |
upper()
Get the upper(field) function This renders the upper function in all dialects: upper([this]) |
||
Field<BigDecimal> |
varPop()
Get the population variance of a numeric field: var_pop(field) This is known to be supported in any of these RDBMS: DB2 H2 HSQLDB Ingres MySQL Oracle Postgres SQL Server (stdev) Sybase ASE Sybase SQL Anywhere |
||
WindowPartitionByStep<BigDecimal> |
varPopOver()
The var_pop(field) over ([analytic clause]) function. |
||
Field<BigDecimal> |
varSamp()
Get the sample variance of a numeric field: var_samp(field) This is known to be supported in any of these RDBMS: H2 HSQLDB Ingres MySQL Oracle Postgres SQL Server (var) Sybase SQL Anywhere |
||
WindowPartitionByStep<BigDecimal> |
varSampOver()
The var_samp(field) over ([analytic clause]) function. |
||
protected String |
wrapInParentheses(String sql)
Wrap a piece of SQL code in parentheses, if not wrapped already |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.jooq.Field |
---|
equals, getName, getType |
Methods inherited from interface org.jooq.NamedTypeProviderQueryPart |
---|
getCastTypeName, getDataType, getDataType, getTypeName |
Methods inherited from interface org.jooq.QueryPart |
---|
getSQL |
Methods inherited from interface org.jooq.Attachable |
---|
attach |
Methods inherited from interface org.jooq.Adapter |
---|
internalAPI |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Constructor Detail |
---|
protected CustomField(String name, DataType<T> type)
Method Detail |
---|
public final Field<T> as(String alias)
as
in interface AliasProvider<Field<T>>
as
in interface Field<T>
alias
- The alias name
public final Field<T> add(Field<? extends Number> value)
add
in interface Field<T>
public final Field<T> mul(Field<? extends Number> value)
mul
in interface Field<T>
public boolean isNullLiteral()
null
literal.
This method is for JOOQ INTERNAL USE only!
This method was added to be able to recognise null
literals
within jOOQ and handle them specially, as some SQL dialects have a rather
un-intuitive way of handling null
values.
isNullLiteral
in interface Field<T>
public List<Attachable> getAttachables()
Attachables
This method is for JOOQ INTERNAL USE only. Do not reference directly
public abstract void toSQL(RenderContext context)
QueryPartInternal
QueryPart
to a SQL string contained in
context.sql()
. The context
will contain
additional information about how to render this QueryPart
,
e.g. whether this QueryPart
should be rendered as a
declaration or reference, whether this QueryPart
's contained
bind variables should be inlined or replaced by '?'
, etc.
toSQL
in interface QueryPartInternal
public abstract void bind(BindContext context) throws SQLException
QueryPartInternal
This method is for JOOQ INTERNAL USE only. Do not reference directly
bind
in interface QueryPartInternal
context
- The context holding the next bind index and other
information for variable binding
SQLException
public final <Z> Field<Z> cast(Field<Z> field)
Field
This results in the same as casting this field to
NamedTypeProviderQueryPart.getCastTypeName()
cast
in interface Field<T>
Z
- The generic type of the cast fieldfield
- The field whose type is used for the cast
Field.cast(DataType)
public final <Z> Field<Z> cast(DataType<Z> type)
Field
cast
in interface Field<T>
Z
- The generic type of the cast fieldpublic final <Z> Field<Z> cast(Class<? extends Z> type)
Field
The actual cast may not be accurate as the DataType
has to be
"guessed" from the jOOQ-configured data types. Use
Field.cast(DataType)
for more accurate casts.
cast
in interface Field<T>
Z
- The generic type of the cast fieldtype
- The type that is used for the cast
Field.cast(DataType)
public final SortField<T> asc()
Field
asc
in interface Field<T>
public final SortField<T> desc()
Field
desc
in interface Field<T>
public final SortField<Integer> sortAsc(Collection<T> sortList)
Field
CASE [this] WHEN [sortList.get(0)] THEN 0
WHEN [sortList.get(1)] THEN 1
...
WHEN [sortList.get(n)] THEN n
ELSE null
END ASC
Note: You can use this in combination with SortField.nullsFirst()
or SortField.nullsLast()
to specify whether the default should
have highest or lowest priority.
sortAsc
in interface Field<T>
sortList
- The list containing sort value preferences
public final SortField<Integer> sortAsc(T... sortList)
Field
CASE [this] WHEN [sortList[0]] THEN 0
WHEN [sortList[1]] THEN 1
...
WHEN [sortList[n]] THEN n
ELSE null
END ASC
Note: You can use this in combination with SortField.nullsFirst()
or SortField.nullsLast()
to specify whether the default should
have highest or lowest priority.
sortAsc
in interface Field<T>
sortList
- The list containing sort value preferences
public final SortField<Integer> sortDesc(Collection<T> sortList)
Field
CASE [this] WHEN [sortList.get(0)] THEN 0
WHEN [sortList.get(1)] THEN 1
...
WHEN [sortList.get(n)] THEN n
ELSE null
END DESC
Note: You can use this in combination with SortField.nullsFirst()
or SortField.nullsLast()
to specify whether the default should
have highest or lowest priority.
sortDesc
in interface Field<T>
sortList
- The list containing sort value preferences
public final SortField<Integer> sortDesc(T... sortList)
Field
CASE [this] WHEN [sortList[0]] THEN 0
WHEN [sortList[1]] THEN 1
...
WHEN [sortList[n]] THEN n
ELSE null
END DESC
Note: You can use this in combination with SortField.nullsFirst()
or SortField.nullsLast()
to specify whether the default should
have highest or lowest priority.
sortDesc
in interface Field<T>
sortList
- The list containing sort value preferences
public final <Z> SortField<Z> sort(Map<T,Z> sortMap)
Field
CASE [this] WHEN [sortMap.key(0)] THEN sortMap.value(0)
WHEN [sortMap.key(1)] THEN sortMap.value(1)
...
WHEN [sortMap.key(n)] THEN sortMap.value(n)
ELSE null
END DESC
Note: You can use this in combination with SortField.nullsFirst()
or SortField.nullsLast()
to specify whether the default should
have highest or lowest priority.
sort
in interface Field<T>
sortMap
- The list containing sort value preferences
public final Field<T> neg()
Field
This renders the same on all dialects:
-[this]
neg
in interface Field<T>
public final Field<T> add(Number value)
Field
add
in interface Field<T>
public final Field<T> sub(Number value)
Field
sub
in interface Field<T>
public final Field<T> sub(Field<? extends Number> value)
Field
sub
in interface Field<T>
public final Field<T> mul(Number value)
Field
mul
in interface Field<T>
public final Field<T> div(Number value)
Field
div
in interface Field<T>
public final Field<T> div(Field<? extends Number> value)
Field
div
in interface Field<T>
public final Field<T> mod(Number value)
Field
This renders the modulo operation where available:
... or the modulo function elsewhere:
[this] % [value]
mod([this], [value])
mod
in interface Field<T>
public final Field<T> mod(Field<? extends Number> value)
Field
This renders the modulo operation where available:
... or the modulo function elsewhere:
[this] % [value]
mod([this], [value])
mod
in interface Field<T>
public final WindowPartitionByStep<Integer> countOver()
Field
count(field) over ([analytic clause])
function.
Window functions are supported in DB2, Postgres, Oracle, SQL Server and Sybase.
countOver
in interface Field<T>
public final WindowPartitionByStep<T> maxOver()
Field
max(field) over ([analytic clause])
function.
Window functions are supported in DB2, Postgres, Oracle, SQL Server and Sybase.
maxOver
in interface Field<T>
public final WindowPartitionByStep<T> minOver()
Field
min(field) over ([analytic clause])
function.
Window functions are supported in DB2, Postgres, Oracle, SQL Server and Sybase.
minOver
in interface Field<T>
public final WindowPartitionByStep<BigDecimal> sumOver()
Field
sum(field) over ([analytic clause])
function.
Window functions are supported in DB2, Postgres, Oracle, SQL Server and Sybase.
sumOver
in interface Field<T>
public final WindowPartitionByStep<BigDecimal> avgOver()
Field
avg(field) over ([analytic clause])
function.
Window functions are supported in DB2, Postgres, Oracle, SQL Server and Sybase.
avgOver
in interface Field<T>
public final org.jooq.impl.WindowFunction<T> firstValue()
Field
first_value(field) over ([analytic clause])
function.
Window functions are supported in DB2, Postgres, Oracle, SQL Server and Sybase.
firstValue
in interface Field<T>
public final org.jooq.impl.WindowFunction<T> lastValue()
Field
last_value(field) over ([analytic clause])
function.
Window functions are supported in DB2, Postgres, Oracle, SQL Server and Sybase.
lastValue
in interface Field<T>
public final org.jooq.impl.WindowFunction<T> lead()
Field
lead(field) over ([analytic clause])
function.
Window functions are supported in DB2, Postgres, Oracle, SQL Server and Sybase.
lead
in interface Field<T>
public final org.jooq.impl.WindowFunction<T> lead(int offset)
Field
lead(field, offset) over ([analytic clause])
function.
Window functions are supported in DB2, Postgres, Oracle, SQL Server and Sybase.
lead
in interface Field<T>
public final org.jooq.impl.WindowFunction<T> lead(int offset, T defaultValue)
Field
lead(field, offset, defaultValue) over ([analytic clause])
function.
Window functions are supported in DB2, Postgres, Oracle, SQL Server and Sybase.
lead
in interface Field<T>
public final org.jooq.impl.WindowFunction<T> lead(int offset, Field<T> defaultValue)
Field
lead(field, offset, defaultValue) over ([analytic clause])
function.
Window functions are supported in DB2, Postgres, Oracle, SQL Server and Sybase.
lead
in interface Field<T>
public final org.jooq.impl.WindowFunction<T> lag()
Field
lag(field) over ([analytic clause])
function.
Window functions are supported in DB2, Postgres, Oracle, SQL Server and Sybase.
lag
in interface Field<T>
public final org.jooq.impl.WindowFunction<T> lag(int offset)
Field
lag(field, offset) over ([analytic clause])
function.
Window functions are supported in DB2, Postgres, Oracle, SQL Server and Sybase.
lag
in interface Field<T>
public final org.jooq.impl.WindowFunction<T> lag(int offset, T defaultValue)
Field
lag(field, offset, defaultValue) over ([analytic clause])
function.
Window functions are supported in DB2, Postgres, Oracle, SQL Server and Sybase.
lag
in interface Field<T>
public final org.jooq.impl.WindowFunction<T> lag(int offset, Field<T> defaultValue)
Field
lag(field, offset, defaultValue) over ([analytic clause])
function.
Window functions are supported in DB2, Postgres, Oracle, SQL Server and Sybase.
lag
in interface Field<T>
public final WindowPartitionByStep<BigDecimal> stddevPopOver()
Field
stddev_pop(field) over ([analytic clause])
function.
Window functions are supported in DB2, Postgres, Oracle, SQL Server and Sybase.
stddevPopOver
in interface Field<T>
public final WindowPartitionByStep<BigDecimal> stddevSampOver()
Field
stddev_samp(field) over ([analytic clause])
function.
Window functions are supported in DB2, Postgres, Oracle, SQL Server and Sybase.
stddevSampOver
in interface Field<T>
public final WindowPartitionByStep<BigDecimal> varPopOver()
Field
var_pop(field) over ([analytic clause])
function.
Window functions are supported in DB2, Postgres, Oracle, SQL Server and Sybase.
varPopOver
in interface Field<T>
public final WindowPartitionByStep<BigDecimal> varSampOver()
Field
var_samp(field) over ([analytic clause])
function.
Window functions are supported in DB2, Postgres, Oracle, SQL Server and Sybase.
varSampOver
in interface Field<T>
public final Field<Integer> count()
Field
count
in interface Field<T>
Factory.count()
public final Field<Integer> countDistinct()
Field
countDistinct
in interface Field<T>
Factory.count()
public final Field<T> max()
Field
max
in interface Field<T>
public final Field<T> min()
Field
min
in interface Field<T>
public final Field<BigDecimal> sum()
Field
sum
in interface Field<T>
public final Field<BigDecimal> avg()
Field
avg
in interface Field<T>
public final Field<BigDecimal> median()
Field
This is known to be supported in any of these RDBMS:
median
in interface Field<T>
public final Field<BigDecimal> stddevPop()
Field
This is known to be supported in any of these RDBMS:
stddevPop
in interface Field<T>
public final Field<BigDecimal> stddevSamp()
Field
This is known to be supported in any of these RDBMS:
stddevSamp
in interface Field<T>
public final Field<BigDecimal> varPop()
Field
This is known to be supported in any of these RDBMS:
varPop
in interface Field<T>
public final Field<BigDecimal> varSamp()
Field
This is known to be supported in any of these RDBMS:
varSamp
in interface Field<T>
public final Field<Integer> sign()
Field
This renders the sign function where available:
... or simulates it elsewhere (without bind variables on values -1, 0, 1):
sign([this])
CASE WHEN [this] > 0 THEN 1
WHEN [this] < 0 THEN -1
ELSE 0
END
public final Field<T> abs()
Field
This renders the same on all dialects:
abs([this])
abs
in interface Field<T>
public final Field<T> round()
Field
This renders the round function where available:
... or simulates it elsewhere using floor and ceil
round([this]) or
round([this], 0)
round
in interface Field<T>
public final Field<T> round(int decimals)
Field
This renders the round function where available:
... or simulates it elsewhere using floor and ceil
round([this], [decimals])
round
in interface Field<T>
public final Field<T> floor()
Field
This renders the floor function where available:
... or simulates it elsewhere using round:
floor([this])
round([this] - 0.499999999999999)
floor
in interface Field<T>
public final Field<T> ceil()
Field
This renders the ceil or ceiling function where available:
... or simulates it elsewhere using round:
ceil([this]) or
ceiling([this])
round([this] + 0.499999999999999)
ceil
in interface Field<T>
public final Field<T> greatest(T... others)
Field
This function has no equivalent in Adaptive Server, Derby, SQL Server and
Sybase SQL Anywhere. Its current simulation implementation has
O(2^n)
complexity and should be avoided for
n > 5
! Better implementation suggestions are very
welcome.
greatest
in interface Field<T>
Field.greatest(Field...)
public final Field<T> greatest(Field<?>... others)
Field
This function has no equivalent in Adaptive Server, Derby, SQL Server and
Sybase SQL Anywhere. Its current simulation implementation has
O(2^n)
complexity and should be avoided for
n > 5
! Better implementation suggestions are very
welcome.
greatest
in interface Field<T>
public final Field<T> least(T... others)
Field
This function has no equivalent in Adaptive Server, Derby, SQL Server and
Sybase SQL Anywhere. Its current simulation implementation has
O(2^n)
complexity and should be avoided for
n > 5
! Better implementation suggestions are very
welcome.
least
in interface Field<T>
Field.least(Field...)
public final Field<T> least(Field<?>... others)
Field
This function has no equivalent in Adaptive Server, Derby, SQL Server and
Sybase SQL Anywhere. Its current simulation implementation has
O(2^n)
complexity and should be avoided for
n > 5
! Better implementation suggestions are very
welcome.
least
in interface Field<T>
public final Field<BigDecimal> sqrt()
Field
This renders the sqrt function where available:
... or simulates it elsewhere using
power (which in turn may also be simulated using ln and exp functions):
sqrt([this])
power([this], 0.5)
sqrt
in interface Field<T>
public final Field<BigDecimal> exp()
Field
This renders the same on all dialects:
exp([this])
exp
in interface Field<T>
public final Field<BigDecimal> ln()
Field
This renders the ln or log function where available:
ln([this]) or
log([this])
ln
in interface Field<T>
public final Field<BigDecimal> log(int base)
Field
This renders the log function where available:
... or simulates it elsewhere (in
most RDBMS) using the natural logarithm:
log([this])
ln([this]) / ln([base])
log
in interface Field<T>
public final Field<BigDecimal> power(Number exponent)
Field
This renders the power function where available:
... or simulates it
elsewhere using ln and exp:
power([this], [exponent])
exp(ln([this]) * [exponent])
power
in interface Field<T>
public final Field<BigDecimal> acos()
Field
This renders the acos function where available:
acos([this])
acos
in interface Field<T>
public final Field<BigDecimal> asin()
Field
This renders the asin function where available:
asin([this])
asin
in interface Field<T>
public final Field<BigDecimal> atan()
Field
This renders the atan function where available:
atan([this])
atan
in interface Field<T>
public final Field<BigDecimal> atan2(Number y)
Field
This renders the atan2 or atn2 function where available:
atan2([this]) or
atn2([this])
atan2
in interface Field<T>
public final Field<BigDecimal> atan2(Field<? extends Number> y)
Field
This renders the atan2 or atn2 function where available:
atan2([this]) or
atn2([this])
atan2
in interface Field<T>
public final Field<BigDecimal> cos()
Field
This renders the cos function where available:
cos([this])
cos
in interface Field<T>
public final Field<BigDecimal> sin()
Field
This renders the sin function where available:
sin([this])
sin
in interface Field<T>
public final Field<BigDecimal> tan()
Field
This renders the tan function where available:
tan([this])
tan
in interface Field<T>
public final Field<BigDecimal> cot()
Field
This renders the cot function where available:
... or simulates it elsewhere using
sin and cos: cot([this])
cos([this]) / sin([this])
cot
in interface Field<T>
public final Field<BigDecimal> sinh()
Field
This renders the sinh function where available:
... or simulates it elsewhere using
exp: sinh([this])
(exp([this] * 2) - 1) / (exp([this] * 2))
sinh
in interface Field<T>
public final Field<BigDecimal> cosh()
Field
This renders the cosh function where available:
... or simulates it elsewhere using
exp: cosh([this])
(exp([this] * 2) + 1) / (exp([this] * 2))
cosh
in interface Field<T>
public final Field<BigDecimal> tanh()
Field
This renders the tanh function where available:
... or simulates it elsewhere using
exp:
tanh([this])
(exp([this] * 2) - 1) / (exp([this] * 2) + 1)
tanh
in interface Field<T>
public final Field<BigDecimal> coth()
Field
This is not supported by any RDBMS, but simulated using exp exp:
(exp([this] * 2) + 1) / (exp([this] * 2) - 1)
coth
in interface Field<T>
public final Field<BigDecimal> deg()
Field
This renders the degrees function where available:
... or simulates it elsewhere:
degrees([this])
[this] * 180 / PI
deg
in interface Field<T>
public final Field<BigDecimal> rad()
Field
This renders the degrees function where available:
... or simulates it elsewhere:
degrees([this])
[this] * PI / 180
rad
in interface Field<T>
public final Field<String> upper()
Field
This renders the upper function in all dialects:
upper([this])
upper
in interface Field<T>
public final Field<String> lower()
Field
This renders the lower function in all dialects:
lower([this])
lower
in interface Field<T>
public final Field<String> trim()
Field
This renders the trim function where available:
... or simulates it elsewhere using
rtrim and ltrim: trim([this])
ltrim(rtrim([this]))
trim
in interface Field<T>
public final Field<String> rtrim()
Field
This renders the rtrim function in all dialects:
rtrim([this])
rtrim
in interface Field<T>
public final Field<String> ltrim()
Field
This renders the ltrim function in all dialects:
ltrim([this])
ltrim
in interface Field<T>
public final Field<String> rpad(Field<? extends Number> length)
Field
This renders the rpad function where available:
... or simulates it
elsewhere using concat, repeat, and length, which may be simulated as
well, depending on the RDBMS:
rpad([this], [length])
concat([this], repeat(' ', [length] - length([this])))
rpad
in interface Field<T>
public final Field<String> rpad(int length)
Field
This renders the rpad function where available:
... or simulates it
elsewhere using concat, repeat, and length, which may be simulated as
well, depending on the RDBMS:
rpad([this], [length])
concat([this], repeat(' ', [length] - length([this])))
rpad
in interface Field<T>
public final Field<String> rpad(Field<? extends Number> length, Field<String> c)
Field
This renders the rpad function where available:
... or simulates it
elsewhere using concat, repeat, and length, which may be simulated as
well, depending on the RDBMS:
rpad([this], [length])
concat([this], repeat([character], [length] - length([this])))
rpad
in interface Field<T>
public final Field<String> rpad(int length, char c)
Field
This renders the rpad function where available:
... or simulates it
elsewhere using concat, repeat, and length, which may be simulated as
well, depending on the RDBMS:
rpad([this], [length])
concat([this], repeat([character], [length] - length([this])))
rpad
in interface Field<T>
public final Field<String> lpad(Field<? extends Number> length)
Field
This renders the lpad function where available:
... or simulates it
elsewhere using concat, repeat, and length, which may be simulated as
well, depending on the RDBMS:
lpad([this], [length])
concat(repeat(' ', [length] - length([this])), [this])
lpad
in interface Field<T>
public final Field<String> lpad(int length)
Field
This renders the lpad function where available:
... or simulates it
elsewhere using concat, repeat, and length, which may be simulated as
well, depending on the RDBMS:
lpad([this], [length])
concat(repeat(' ', [length] - length([this])), [this])
lpad
in interface Field<T>
public final Field<String> lpad(Field<? extends Number> length, Field<String> c)
Field
This renders the lpad function where available:
... or simulates it
elsewhere using concat, repeat, and length, which may be simulated as
well, depending on the RDBMS:
lpad([this], [length])
concat(repeat([character], [length] - length([this])), [this])
lpad
in interface Field<T>
public final Field<String> lpad(int length, char c)
Field
This renders the lpad function where available:
... or simulates it
elsewhere using concat, repeat, and length, which may be simulated as
well, depending on the RDBMS:
lpad([this], [length])
concat(repeat([character], [length] - length([this])), [this])
lpad
in interface Field<T>
public final Field<String> repeat(Number count)
Field
This renders the repeat or replicate function where available:
... or simulates it elsewhere
using rpad and length, which may be simulated as well, depending on the
RDBMS:
repeat([this], [count]) or
replicate([this], [count])
rpad([this], length([this]) * [count], [this])
repeat
in interface Field<T>
public final Field<String> repeat(Field<? extends Number> count)
Field
This renders the repeat or replicate function where available:
... or simulates it elsewhere
using rpad and length, which may be simulated as well, depending on the
RDBMS:
repeat([this], [count]) or
replicate([this], [count])
rpad([this], length([this]) * [count], [this])
repeat
in interface Field<T>
public final Field<String> replace(Field<String> search)
Field
This renders the replace or str_replace function where available:
... or simulates it elsewhere
using the three-argument replace function:
replace([this], [search]) or
str_replace([this], [search])
replace([this], [search], '')
replace
in interface Field<T>
public final Field<String> replace(String search)
Field
This renders the replace or str_replace function where available:
... or simulates it elsewhere
using the three-argument replace function:
replace([this], [search]) or
str_replace([this], [search])
replace([this], [search], '')
replace
in interface Field<T>
public final Field<String> replace(Field<String> search, Field<String> replace)
Field
This renders the replace or str_replace function:
replace([this], [search]) or
str_replace([this], [search])
replace
in interface Field<T>
public final Field<String> replace(String search, String replace)
Field
This renders the replace or str_replace function:
replace([this], [search]) or
str_replace([this], [search])
replace
in interface Field<T>
public final Field<Integer> position(String search) throws SQLDialectNotSupportedException
Field
This renders the position or any equivalent function:
position([search] in [this]) or
locate([this], [search]) or
locate([search], [this]) or
instr([this], [search]) or
charindex([search], [this])
position
in interface Field<T>
SQLDialectNotSupportedException
public final Field<Integer> position(Field<String> search) throws SQLDialectNotSupportedException
Field
This renders the position or any equivalent function:
position([search] in [this]) or
locate([this], [search]) or
locate([search], [this]) or
instr([this], [search]) or
charindex([search], [this])
position
in interface Field<T>
SQLDialectNotSupportedException
public final Field<Integer> ascii()
Field
This renders the replace or str_replace function:
ascii([this])
ascii
in interface Field<T>
public final Field<String> concat(Field<?>... fields)
Expression
to generate neater expressions
concat
in interface Field<T>
public final Field<String> concat(String... values)
Field
This creates this || fields[0] || fields[1] || ...
as an
expression, or concat(this, fields[0], fields[1], ...)
,
depending on the dialect.
concat
in interface Field<T>
public final Field<String> substring(int startingPosition)
Field
This renders the substr or substring function:
substr([this], [startingPosition]) or
substring([this], [startingPosition])
substring
in interface Field<T>
public final Field<String> substring(int startingPosition, int length)
Field
This renders the substr or substring function:
substr([this], [startingPosition], [length]) or
substring([this], [startingPosition], [length])
substring
in interface Field<T>
public final Field<String> substring(Field<? extends Number> startingPosition)
Field
This renders the substr or substring function:
substr([this], [startingPosition]) or
substring([this], [startingPosition])
substring
in interface Field<T>
public final Field<String> substring(Field<? extends Number> startingPosition, Field<? extends Number> length)
Field
This renders the substr or substring function:
substr([this], [startingPosition], [length]) or
substring([this], [startingPosition], [length])
substring
in interface Field<T>
public final Field<Integer> length()
Field
VARCHAR
type. This is a synonym for
Field.charLength()
length
in interface Field<T>
Field.charLength()
public final Field<Integer> charLength()
Field
This translates into any dialect
charLength
in interface Field<T>
public final Field<Integer> bitLength()
Field
This translates into any dialect
bitLength
in interface Field<T>
public final Field<Integer> octetLength()
Field
This translates into any dialect
octetLength
in interface Field<T>
public final Field<Integer> extract(DatePart datePart)
Field
This translates into any dialect
extract
in interface Field<T>
public final Field<T> nvl(Field<T> defaultValue)
Field
Returns the dialect's equivalent to NVL:
nvl
in interface Field<T>
public final Field<T> nvl(T defaultValue)
Field
nvl
in interface Field<T>
Field.nvl(Field)
public final <Z> Field<Z> nvl2(Field<Z> valueIfNotNull, Field<Z> valueIfNull)
Field
Returns the dialect's equivalent to NVL2:
Other dialects:
CASE WHEN [value] IS NULL THEN [valueIfNull] ELSE [valueIfNotNull] END
nvl2
in interface Field<T>
public final <Z> Field<Z> nvl2(Z valueIfNotNull, Z valueIfNull)
Field
nvl2
in interface Field<T>
Field.nvl2(Field, Field)
public final Field<T> nullif(T other)
Field
nullif
in interface Field<T>
Field.nullif(Field)
public final Field<T> nullif(Field<T> other)
Field
Returns the dialect's equivalent to NULLIF:
nullif
in interface Field<T>
public final <Z> Field<Z> decode(T search, Z result)
Field
DECODE(expression, search, result[, search , result]... [, default])
function
decode
in interface Field<T>
Field.decode(Field, Field, Field[])
public final <Z> Field<Z> decode(T search, Z result, Object... more)
Field
DECODE(expression, search, result[, search , result]... [, default])
function
decode
in interface Field<T>
Field.decode(Field, Field, Field[])
public final <Z> Field<Z> decode(Field<T> search, Field<Z> result)
Field
DECODE(expression, search, result[, search , result]... [, default])
function
decode
in interface Field<T>
Field.decode(Field, Field, Field[])
public final <Z> Field<Z> decode(Field<T> search, Field<Z> result, Field<?>... more)
Field
DECODE(expression, search, result[, search , result]... [, default])
function
Returns the dialect's equivalent to DECODE:
Other dialects:
CASE WHEN [this = search] THEN [result],
[WHEN more... THEN more...]
[ELSE more...]
END
decode
in interface Field<T>
search
- the mandatory first search parameterresult
- the mandatory first result parametermore
- the optional parameters. If more.length
is even,
then it is assumed that it contains more search/result pairs.
If more.length
is odd, then it is assumed that it
contains more search/result pairs plus a default at the end.public final Field<T> coalesce(T option, T... options)
Field
COALESCE(expr1, expr2, ... , exprn)
function
coalesce
in interface Field<T>
Field.coalesce(Field, Field...)
public final Field<T> coalesce(Field<T> option, Field<?>... options)
Field
COALESCE(expr1, expr2, ... , exprn)
function
Returns the dialect's equivalent to COALESCE:
coalesce
in interface Field<T>
public final Condition isNull()
Field
this is null
isNull
in interface Field<T>
public final Condition isNotNull()
Field
this is not null
isNotNull
in interface Field<T>
public final Condition isTrue()
Field
lcase(this) in ("1", "y", "yes", "true", "on", "enabled")
isTrue
in interface Field<T>
public final Condition isFalse()
Field
lcase(this) in ("0", "n", "no", "false", "off", "disabled")
isFalse
in interface Field<T>
public final Condition like(T value)
Field
this like value
like
in interface Field<T>
public final Condition notLike(T value)
Field
this not like value
notLike
in interface Field<T>
public final Condition in(T... values)
Field
this in (values...)
in
in interface Field<T>
public final Condition in(Field<?>... values)
Field
this in (values...)
in
in interface Field<T>
public final Condition in(Collection<T> values)
Field
this in (values...)
in
in interface Field<T>
public final Condition in(Select<?> query)
Field
this in (select...)
in
in interface Field<T>
public final Condition notIn(T... values)
Field
this not in (values...)
notIn
in interface Field<T>
public final Condition notIn(Field<?>... values)
Field
this not in (values...)
notIn
in interface Field<T>
public final Condition notIn(Collection<T> values)
Field
this not in (values...)
notIn
in interface Field<T>
public final Condition notIn(Select<?> query)
Field
this not in (select...)
notIn
in interface Field<T>
public final Condition between(T minValue, T maxValue)
Field
this between minValue and maxValue
between
in interface Field<T>
public final Condition between(Field<T> minValue, Field<T> maxValue)
Field
this between minValue and maxValue
between
in interface Field<T>
public final Condition equal(T value)
Field
this = value
equal
in interface Field<T>
public final Condition equal(Field<T> field)
Field
this = field
equal
in interface Field<T>
public final Condition equal(Select<?> query)
Field
this = (Select> ...)
equal
in interface Field<T>
public final Condition equalAny(Select<?> query)
Field
this = any (Select> ...)
equalAny
in interface Field<T>
public final Condition equalSome(Select<?> query)
Field
this = some (Select> ...)
equalSome
in interface Field<T>
public final Condition equalAll(Select<?> query)
Field
this = all (Select> ...)
equalAll
in interface Field<T>
public final Condition notEqual(T value)
Field
this != value
notEqual
in interface Field<T>
public final Condition notEqual(Field<T> field)
Field
this != field
notEqual
in interface Field<T>
public final Condition notEqual(Select<?> query)
Field
this != (Select> ...)
notEqual
in interface Field<T>
public final Condition notEqualAny(Select<?> query)
Field
this != any (Select> ...)
notEqualAny
in interface Field<T>
public final Condition notEqualSome(Select<?> query)
Field
this != some (Select> ...)
notEqualSome
in interface Field<T>
public final Condition notEqualAll(Select<?> query)
Field
this != all (Select> ...)
notEqualAll
in interface Field<T>
public final Condition lessThan(T value)
Field
this < value
lessThan
in interface Field<T>
public final Condition lessThan(Field<T> field)
Field
this < field
lessThan
in interface Field<T>
public final Condition lessThan(Select<?> query)
Field
this < (Select> ...)
lessThan
in interface Field<T>
public final Condition lessThanAny(Select<?> query)
Field
this < any (Select> ...)
lessThanAny
in interface Field<T>
public final Condition lessThanSome(Select<?> query)
Field
this < some (Select> ...)
lessThanSome
in interface Field<T>
public final Condition lessThanAll(Select<?> query)
Field
this < all (Select> ...)
lessThanAll
in interface Field<T>
public final Condition lessOrEqual(T value)
Field
this <= value
lessOrEqual
in interface Field<T>
public final Condition lessOrEqual(Field<T> field)
Field
this <= field
lessOrEqual
in interface Field<T>
public final Condition lessOrEqual(Select<?> query)
Field
this <= (Select> ...)
lessOrEqual
in interface Field<T>
public final Condition lessOrEqualAny(Select<?> query)
Field
this <= any (Select> ...)
lessOrEqualAny
in interface Field<T>
public final Condition lessOrEqualSome(Select<?> query)
Field
this <= some (Select> ...)
lessOrEqualSome
in interface Field<T>
public final Condition lessOrEqualAll(Select<?> query)
Field
this <= all (Select> ...)
lessOrEqualAll
in interface Field<T>
@Deprecated public final Condition lessOrEqualToAny(Select<?> query)
Field
this <= any (Select> ...)
lessOrEqualToAny
in interface Field<T>
@Deprecated public final Condition lessOrEqualToSome(Select<?> query)
Field
this <= some (Select> ...)
lessOrEqualToSome
in interface Field<T>
@Deprecated public final Condition lessOrEqualToAll(Select<?> query)
Field
this <= all (Select> ...)
lessOrEqualToAll
in interface Field<T>
public final Condition greaterThan(T value)
Field
this > value
greaterThan
in interface Field<T>
public final Condition greaterThan(Field<T> field)
Field
this > field
greaterThan
in interface Field<T>
public final Condition greaterThan(Select<?> query)
Field
this > (Select> ...)
greaterThan
in interface Field<T>
public final Condition greaterThanAny(Select<?> query)
Field
this > any (Select> ...)
greaterThanAny
in interface Field<T>
public final Condition greaterThanSome(Select<?> query)
Field
this > some (Select> ...)
greaterThanSome
in interface Field<T>
public final Condition greaterThanAll(Select<?> query)
Field
this > all (Select> ...)
greaterThanAll
in interface Field<T>
public final Condition greaterOrEqual(T value)
Field
this >= value
greaterOrEqual
in interface Field<T>
public final Condition greaterOrEqual(Field<T> field)
Field
this >= field
greaterOrEqual
in interface Field<T>
public final Condition greaterOrEqual(Select<?> query)
Field
this >= (Select> ...)
greaterOrEqual
in interface Field<T>
public final Condition greaterOrEqualAny(Select<?> query)
Field
this >= any (Select> ...)
greaterOrEqualAny
in interface Field<T>
public final Condition greaterOrEqualSome(Select<?> query)
Field
this >= some (Select> ...)
greaterOrEqualSome
in interface Field<T>
public final Condition greaterOrEqualAll(Select<?> query)
Field
this >= all (Select> ...)
greaterOrEqualAll
in interface Field<T>
public final DataType<T> getDataType()
NamedTypeProviderQueryPart
getDataType
in interface NamedTypeProviderQueryPart<T>
protected final SQLDataType<T> getSQLDataType()
public final DataType<T> getDataType(Configuration configuration)
NamedTypeProviderQueryPart
getDataType
in interface NamedTypeProviderQueryPart<T>
public final Class<? extends T> getType()
NamedTypeProviderQueryPart
getType
in interface NamedTypeProviderQueryPart<T>
@Deprecated public final String getTypeName()
NamedTypeProviderQueryPart
getTypeName
in interface NamedTypeProviderQueryPart<T>
@Deprecated public final String getCastTypeName()
NamedTypeProviderQueryPart
getCastTypeName
in interface NamedTypeProviderQueryPart<T>
public final String getName()
NamedQueryPart
getName
in interface NamedQueryPart
public final int compareTo(NamedQueryPart that)
compareTo
in interface Comparable<NamedQueryPart>
public final <I> I internalAPI(Class<I> internalType)
Adapter
This is for JOOQ INTERNAL USE only. If you need to access the internal API, these are the known possible interfaces:
QueryPartInternal
: The internal API for QueryPart
internalAPI
in interface Adapter
I
- The internal type's generic type parameter.internalType
- The internal type
public void attach(Configuration configuration)
attach
in interface Attachable
public final Configuration getConfiguration()
AttachableInternal
getConfiguration
in interface AttachableInternal
public final SQLDialect getDialect()
QueryPartInternal
This method is for JOOQ INTERNAL USE only. Do not reference directly
getDialect
in interface QueryPartInternal
public final String getSQL()
QueryPart
getSQL
in interface QueryPart
public final List<Object> getBindValues()
QueryPartInternal
This method is exposed publicly in Query.getBindValues()
getBindValues
in interface QueryPartInternal
@Deprecated public final String toSQLReference(Configuration configuration)
QueryPartInternal
toSQLReference(configuration, false)
This method is for JOOQ INTERNAL USE only. Do not reference directly
toSQLReference
in interface QueryPartInternal
configuration
- The configuration overriding dialects and schemata
QueryPartInternal.toSQLReference(Configuration, boolean)
@Deprecated public final String toSQLReference(Configuration configuration, boolean inlineParameters)
QueryPartInternal
This method is for JOOQ INTERNAL USE only. Do not reference directly
toSQLReference
in interface QueryPartInternal
configuration
- The configuration overriding dialects and schematainlineParameters
- if set to true, all parameters are inlined, not
replaced by "?"
@Deprecated public final String toSQLDeclaration(Configuration configuration)
QueryPartInternal
toSQLReference(configuration, false)
This method is for JOOQ INTERNAL USE only. Do not reference directly
toSQLDeclaration
in interface QueryPartInternal
configuration
- The configuration overriding dialects and schemata
QueryPartInternal.toSQLDeclaration(Configuration, boolean)
@Deprecated public final String toSQLDeclaration(Configuration configuration, boolean inlineParameters)
QueryPartInternal
toSQLReference(Configuration, boolean)
This method is for JOOQ INTERNAL USE only. Do not reference directly
toSQLDeclaration
in interface QueryPartInternal
configuration
- The configuration overriding dialects and schematainlineParameters
- if set to true, all parameters are inlined, not
replaced by "?"
@Deprecated public final int bind(Configuration configuration, PreparedStatement stmt) throws SQLException
QueryPartInternal
bind(configuration, stmt, 1)
This method is for JOOQ INTERNAL USE only. Do not reference directly
bind
in interface QueryPartInternal
configuration
- The configuration overriding dialects and schematastmt
- The statement to bind values to
SQLException
QueryPartInternal.bind(Configuration, PreparedStatement, int)
@Deprecated public final int bind(Configuration configuration, PreparedStatement stmt, int initialIndex) throws SQLException
QueryPartInternal
This method is for JOOQ INTERNAL USE only. Do not reference directly
bind
in interface QueryPartInternal
configuration
- The configuration overriding dialects and schematastmt
- The statement to bind values toinitialIndex
- The index of the next binding variable
SQLException
@Deprecated public final int bindReference(Configuration configuration, PreparedStatement stmt) throws SQLException
QueryPartInternal
bind(configuration, stmt, 1)
This method is for JOOQ INTERNAL USE only. Do not reference directly
bindReference
in interface QueryPartInternal
configuration
- The configuration overriding dialects and schematastmt
- The statement to bind values to
SQLException
QueryPartInternal.bind(Configuration, PreparedStatement, int)
@Deprecated public final int bindReference(Configuration configuration, PreparedStatement stmt, int initialIndex) throws SQLException
QueryPartInternal
This method is for JOOQ INTERNAL USE only. Do not reference directly
bindReference
in interface QueryPartInternal
configuration
- The configuration overriding dialects and schematastmt
- The statement to bind values toinitialIndex
- The index of the next binding variable
SQLException
@Deprecated public final int bindDeclaration(Configuration configuration, PreparedStatement stmt) throws SQLException
QueryPartInternal
bind(configuration, stmt, 1)
This method is for JOOQ INTERNAL USE only. Do not reference directly
bindDeclaration
in interface QueryPartInternal
configuration
- The configuration overriding dialects and schematastmt
- The statement to bind values to
SQLException
QueryPartInternal.bind(Configuration, PreparedStatement, int)
@Deprecated public final int bindDeclaration(Configuration configuration, PreparedStatement stmt, int initialIndex) throws SQLException
QueryPartInternal
This method is for JOOQ INTERNAL USE only. Do not reference directly
bindDeclaration
in interface QueryPartInternal
configuration
- The configuration overriding dialects and schematastmt
- The statement to bind values toinitialIndex
- The index of the next binding variable
SQLException
public boolean declaresFields()
declaresFields
in interface QueryPartInternal
public boolean declaresTables()
declaresTables
in interface QueryPartInternal
public boolean equals(Object that)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
protected final String wrapInParentheses(String sql)
protected final AttachableInternal internal(Attachable part)
protected final QueryPartInternal internal(QueryPart part)
protected final List<Attachable> getAttachables(Collection<? extends QueryPart> list)
protected final List<Attachable> getAttachables(QueryPart... list)
protected final List<Attachable> getAttachables(Store<?> store)
protected final Factory create()
protected final Factory create(Configuration configuration)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |