Class SQLFieldTransformer
- java.lang.Object
-
- com.nimbusds.infinispan.persistence.sql.transformers.SQLFieldTransformer
-
@ThreadSafe public class SQLFieldTransformer extends java.lang.Object
SQL field transformer.
-
-
Constructor Summary
Constructors Constructor Description SQLFieldTransformer(org.jooq.SQLDialect sqlDialect)
Creates a new SQL field transformer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.time.Instant
parseInstant(java.sql.Timestamp timestamp)
Parses a time instant from the specified SQL timestamp.static net.minidev.json.JSONObject
parseJSONObject(java.lang.String jsonObjectString)
Parses a JSON object from the specified string.java.lang.String[]
parseSQLStringCollection(java.lang.String fieldName, RetrievedSQLRecord sqlRecord)
Parses a string array from the specified SQL record field.java.lang.Object
toSQLCollection(java.util.Collection<?> collection)
Returns the appropriate SQL representation of the specified collection.static java.lang.String
toSQLString(net.minidev.json.JSONObject jsonObject)
Returns the string representation of the specified JSON object.static java.lang.String
toString(java.lang.Object o)
Returns the string representation of the specified object.static java.sql.Timestamp
toTimestamp(java.time.Instant date)
Returns an SQL timestamp representation of the specifiedDate
.
-
-
-
Constructor Detail
-
SQLFieldTransformer
public SQLFieldTransformer(org.jooq.SQLDialect sqlDialect)
Creates a new SQL field transformer.- Parameters:
sqlDialect
- The SQL dialect. Must be for H2, MySQL, PostgreSQL 9.5+ or MS SQL Server 2016. Notnull
.
-
-
Method Detail
-
toString
public static java.lang.String toString(java.lang.Object o)
Returns the string representation of the specified object.- Parameters:
o
- The object,null
if not specified.- Returns:
- The string representation,
null
if not specified.
-
toSQLCollection
public java.lang.Object toSQLCollection(java.util.Collection<?> collection)
Returns the appropriate SQL representation of the specified collection.- Parameters:
collection
- The collection,null
if not specified.- Returns:
- The SQL collection representation,
null
if not specified.
-
toSQLString
public static java.lang.String toSQLString(net.minidev.json.JSONObject jsonObject)
Returns the string representation of the specified JSON object.- Parameters:
jsonObject
- The JSON object,null
if not specified.- Returns:
- The JSON object string representation,
null
if not specified.
-
toTimestamp
public static java.sql.Timestamp toTimestamp(java.time.Instant date)
Returns an SQL timestamp representation of the specifiedDate
.- Parameters:
date
- The date,null
if not specified.- Returns:
- The SQL timestamp,
null
if not specified.
-
parseSQLStringCollection
public java.lang.String[] parseSQLStringCollection(java.lang.String fieldName, RetrievedSQLRecord sqlRecord)
Parses a string array from the specified SQL record field.- Parameters:
fieldName
- The SQL field name. Must not benull
.sqlRecord
- The SQL record. Must not benull
.- Returns:
- The string array,
null
if not specified.
-
parseJSONObject
public static net.minidev.json.JSONObject parseJSONObject(java.lang.String jsonObjectString)
Parses a JSON object from the specified string.- Parameters:
jsonObjectString
- The JSON object string,null
if not specified.- Returns:
- The JSON object,
null
if not specified.
-
parseInstant
public static java.time.Instant parseInstant(java.sql.Timestamp timestamp)
Parses a time instant from the specified SQL timestamp.- Parameters:
timestamp
- The SQL timestamp,null
if not specified.- Returns:
- The time instant,
null
if not specified.
-
-