Class ValueToObjectConverter
java.lang.Object
org.h2.message.TraceObject
org.h2.value.ValueToObjectConverter
Data type conversion methods between values and Java objects.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Class<?> The Geometry class.private static final StringFields inherited from class TraceObject
ARRAY, BLOB, CALLABLE_STATEMENT, CLOB, CONNECTION, DATA_SOURCE, DATABASE_META_DATA, PARAMETER_META_DATA, PREPARED_STATEMENT, RESULT_SET, RESULT_SET_META_DATA, SAVEPOINT, SQLXML, STATEMENT, trace, XA_DATA_SOURCE, XID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static ValuearrayToValue(Session session, Object x) static Class<?> getDefaultClass(int type, boolean forJdbc) Get the name of the Java class for the given value type.static ValueobjectToValue(Session session, Object x, int type) Convert a Java object to a value.private static ValueotherToValue(Session session, Object x) private static LinkedHashMap<String, TypeInfo> readResultSetMeta(Session session, ResultSetMetaData meta, int columnCount) static ValuereadValue(Session session, JdbcResultSet rs, int columnIndex) Read a value from the given result set.(package private) static ValueresultSetToValue(Session session, ResultSet rs) private static ObjectvalueToArray(Class<?> type, Value value, JdbcConnection conn) static ObjectvalueToDefaultArray(Value value, JdbcConnection conn, boolean forJdbc) Converts the specified array value to array of default Java objects for its type.static ObjectvalueToDefaultObject(Value value, JdbcConnection conn, boolean forJdbc) Converts the specified value to the default Java object for its type.static <T> TvalueToObject(Class<T> type, Value value, JdbcConnection conn) Converts the specified value to an object of the specified type.private static ObjectvalueToOther(Class<?> type, Value value, JdbcConnection conn) Methods inherited from class TraceObject
debugCode, debugCodeAssign, debugCodeCall, debugCodeCall, debugCodeCall, getNextId, getTraceId, getTraceObjectName, isDebugEnabled, isInfoEnabled, logAndConvert, quote, quoteArray, quoteBigDecimal, quoteBytes, quoteDate, quoteIntArray, quoteMap, quoteTime, quoteTimestamp, setTrace, unsupported
-
Field Details
-
GEOMETRY_CLASS
The Geometry class. This object is null if the JTS jar file is not in the classpath. -
GEOMETRY_CLASS_NAME
- See Also:
-
-
Constructor Details
-
ValueToObjectConverter
private ValueToObjectConverter()
-
-
Method Details
-
objectToValue
-
otherToValue
-
arrayToValue
-
resultSetToValue
-
readResultSetMeta
private static LinkedHashMap<String,TypeInfo> readResultSetMeta(Session session, ResultSetMetaData meta, int columnCount) throws SQLException - Throws:
SQLException
-
valueToObject
Converts the specified value to an object of the specified type.- Type Parameters:
T- the type- Parameters:
type- the classvalue- the valueconn- the connection- Returns:
- the object of the specified class representing the specified
value, or
null
-
valueToArray
-
valueToOther
-
getDefaultClass
Get the name of the Java class for the given value type.- Parameters:
type- the value typeforJdbc- iftrueget class for JDBC layer, iffalseget class for Java functions API- Returns:
- the class
-
valueToDefaultObject
Converts the specified value to the default Java object for its type.- Parameters:
value- the valueconn- the connectionforJdbc- iftrueperform conversion for JDBC layer, iffalseperform conversion for Java functions API- Returns:
- the object
-
valueToDefaultArray
Converts the specified array value to array of default Java objects for its type.- Parameters:
value- the array valueconn- the connectionforJdbc- iftrueperform conversion for JDBC layer, iffalseperform conversion for Java functions API- Returns:
- the object
-
readValue
Read a value from the given result set.- Parameters:
session- the sessionrs- the result setcolumnIndex- the column index (1-based)- Returns:
- the value
-