T
- the type of the primitive valuepublic class PrimitiveColumnExpression<T> extends Object implements ColumnExpression
ColumnExpression
which contains a primitive value.Modifier and Type | Field and Description |
---|---|
private Function<T,String> |
converter
Converts the primitive value to an SQL string.
|
private T |
databaseValue
The primitive database value (which may be used in an prepared statement).
|
static PrimitiveColumnExpression<Object> |
NULL
Represents an expression of a
null value. |
private T |
value
The original primitive value.
|
Constructor and Description |
---|
PrimitiveColumnExpression(T value,
Function<T,String> converter)
Creates a new instance of an expression where the original value is the database value.
|
PrimitiveColumnExpression(T value,
T databaseValue,
Function<T,String> converter) |
Modifier and Type | Method and Description |
---|---|
static <N extends Number> |
create(N value,
GeneratorDialect dialect)
Creates a new instance of
PrimitiveColumnExpression for a number. |
static PrimitiveColumnExpression<String> |
create(String value,
GeneratorDialect dialect)
Creates a new instance of a
PrimitiveColumnExpression for a string. |
Function<T,String> |
getConverter()
Converts the primitive value to an SQL string.
|
T |
getDatabaseValue()
The primitive database value (which may be used in an prepared statement).
|
T |
getValue()
The original primitive value.
|
String |
toSql()
Generates the SQL for this expression.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
appendSql
public static final PrimitiveColumnExpression<Object> NULL
null
value.private final T value
private final T databaseValue
public PrimitiveColumnExpression(T value, Function<T,String> converter)
value
- the primitive valueconverter
- converts the primitive value to an SQL string@ConstructorProperties(value={"value","databaseValue","converter"}) @Generated(value="lombok") public PrimitiveColumnExpression(T value, T databaseValue, Function<T,String> converter)
public static final <N extends Number> PrimitiveColumnExpression<N> create(N value, GeneratorDialect dialect)
PrimitiveColumnExpression
for a number.value
- the number valuedialect
- the dialect of the current databasepublic static final PrimitiveColumnExpression<String> create(String value, GeneratorDialect dialect)
PrimitiveColumnExpression
for a string.value
- the string valuedialect
- the dialect of the current databasepublic String toSql()
ColumnExpression
toSql
in interface ColumnExpression
@Generated(value="lombok") public T getValue()
@Generated(value="lombok") public T getDatabaseValue()
@Generated(value="lombok") public Function<T,String> getConverter()
Copyright © 2022 fastnate.org. All rights reserved.