Package org.postgresql.jdbc
Class JavaObjectResolver
java.lang.Object
org.postgresql.jdbc.JavaObjectResolver
The motivation behind this class is to deal with:
- autoboxing, the type of the object is not always the same as the type of the column in the database. Ex: Object a = 1; // a is an Integer, but the oid might be INT8
- string to internal pg object representation, check the oid if a string literal can be used to create an internal object like PGBox, PGPoint etc, since users don't have access to those types.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Object
tryResolveObject
(Object in, int oid) Try to resolve the object to the correct type based on the oid, otherwise return the object as is.private static Object
private static Object
private static Object
private static Object
private static Object
private static Object
private static Object
private static Object
private static Object
private static Object
private static Object
tryToResolveObjectToPGObject
(Object in, int oid) private static Object
-
Constructor Details
-
JavaObjectResolver
private JavaObjectResolver()
-
-
Method Details
-
tryResolveObject
Try to resolve the object to the correct type based on the oid, otherwise return the object as is.- Parameters:
in
- the object to resolveoid
- the oid of the column- Returns:
- the resolved object
-
tryResolveObjectToShort
-
tryResolveObjectToInt
-
tryResolveObjectToLong
-
tryResolveObjectToFloat
-
tryResolveObjectToDouble
-
tryToResolveObjectToBigDecimal
-
tryResolveObjectToBoolean
-
tryResolveObjectToChar
-
tryResolveObjectToString
-
tryToResolveObjectToPGPoint
-
tryToResolveObjectToPGBox
-
tryToResolveObjectToPGObject
-