Interface JdbcLiteralFormatter<T>
- Type Parameters:
T- the Java type that this instance formats as a SQL literal
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AbstractJdbcLiteralFormatter,BasicJdbcLiteralFormatter,GeometryLiteralFormatter,JdbcLiteralFormatterArray,JdbcLiteralFormatterBinary,JdbcLiteralFormatterBoolean,JdbcLiteralFormatterCharacterData,JdbcLiteralFormatterNumericData,JdbcLiteralFormatterTemporal,JdbcLiteralFormatterUUIDData
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A formatter object for rendering values of a given Java type
as SQL literals of a certain JDBC/SQL type. Usually, an
instance is obtained by calling
JdbcType.getJdbcLiteralFormatter(JavaType).-
Method Summary
Modifier and TypeMethodDescriptionvoidappendJdbcLiteral(SqlAppender appender, T value, Dialect dialect, WrapperOptions wrapperOptions) Append a SQL literal representing the given Java value to a fragment of SQL which is being built.default StringtoJdbcLiteral(T value, Dialect dialect, WrapperOptions wrapperOptions) Produces a string containing a SQL literal value representing the given Java value.
-
Method Details
-
toJdbcLiteral
Produces a string containing a SQL literal value representing the given Java value.- Parameters:
value- a Java object whose value can be represented as a SQL literaldialect- the SQL dialect- Returns:
- the SQL literal as a string
-
appendJdbcLiteral
void appendJdbcLiteral(SqlAppender appender, T value, Dialect dialect, WrapperOptions wrapperOptions) Append a SQL literal representing the given Java value to a fragment of SQL which is being built.- Parameters:
appender- an operation that appends to the SQL fragmentvalue- a Java object whose value can be represented as a SQL literaldialect- the SQL dialect
-