@ThreadSafe public class SQLFieldTransformer extends Object
| Constructor and Description |
|---|
SQLFieldTransformer(org.jooq.SQLDialect sqlDialect)
Creates a new SQL field transformer.
|
| Modifier and Type | Method and Description |
|---|---|
static java.time.Instant |
parseInstant(Timestamp timestamp)
Parses a time instant from the specified SQL timestamp.
|
static net.minidev.json.JSONObject |
parseJSONObject(String jsonObjectString)
Parses a JSON object from the specified string.
|
String[] |
parseSQLStringCollection(String fieldName,
org.jooq.Record sqlRecord)
Parses a string array from the specified SQL record field.
|
Object |
toSQLCollection(Collection<?> collection)
Returns the appropriate SQL representation of the specified
collection.
|
static String |
toSQLString(net.minidev.json.JSONObject jsonObject)
Returns the string representation of the specified JSON object.
|
static String |
toString(Object o)
Returns the string representation of the specified object.
|
static Timestamp |
toTimestamp(java.time.Instant date)
Returns an SQL timestamp representation of the specified
Date. |
public SQLFieldTransformer(org.jooq.SQLDialect sqlDialect)
sqlDialect - The SQL dialect. Must be for H2, MySQL or
PostgreSQL 9.5. Not null.public static String toString(Object o)
o - The object, null if not specified.null if not specified.public Object toSQLCollection(Collection<?> collection)
collection - The collection, null if not specified.null if not
specified.public static String toSQLString(net.minidev.json.JSONObject jsonObject)
jsonObject - The JSON object, null if not specified.null if not
specified.public static Timestamp toTimestamp(java.time.Instant date)
Date.date - The date, null if not specified.null if not specified.public String[] parseSQLStringCollection(String fieldName, org.jooq.Record sqlRecord)
fieldName - The SQL field name. Must not be null.sqlRecord - The SQL record. Must not be null.null if not specified.public static net.minidev.json.JSONObject parseJSONObject(String jsonObjectString)
jsonObjectString - The JSON object string, null if not
specified.null if not specified.public static java.time.Instant parseInstant(Timestamp timestamp)
timestamp - The SQL timestamp, null if not specified.null if not specified.Copyright © 2016 Connect2id Ltd.. All Rights Reserved.