Package org.eclipse.persistence.pgsql
Class PostgreSQL10JsonPlatform
java.lang.Object
org.eclipse.persistence.json.JsonPlatform
org.eclipse.persistence.pgsql.PostgreSQL10JsonPlatform
- All Implemented Interfaces:
DatabaseJsonPlatform
,PostgreSQL10Platform.PostgreSQL10JsonExtension
public class PostgreSQL10JsonPlatform
extends JsonPlatform
implements PostgreSQL10Platform.PostgreSQL10JsonExtension
PostgreSQL 10 JSON database platform.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T> T
convertJsonValueToDataValue
(JsonValue jsonValue) INTERNAL: Convert JSON value field to JDBC statement type.<T> T
getJsonDataFromResultSet
(ResultSet resultSet, int columnNumber, Class<T> type) Retrieve JSON data from JDBCResultSet
.boolean
isPgObjectInstance
(Object parameter) Check whether provided instance is an instance ofPGobject
.void
updateClassTypes
(Map<String, Class<?>> classTypeMapping) Update the mapping of Postgres 10 database types to class types for the schema framework.void
updateFieldTypes
(Hashtable<Class<?>, FieldTypeDefinition> fieldTypeMapping) Update the mapping of JSON class types to Postgres 10 database types for the schema framework.Methods inherited from class org.eclipse.persistence.json.JsonPlatform
convertDataValueToJsonValue, isJsonType
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.persistence.internal.databaseaccess.DatabaseJsonPlatform
customParameterMarker, unwrap
-
Constructor Details
-
PostgreSQL10JsonPlatform
public PostgreSQL10JsonPlatform()
-
-
Method Details
-
updateClassTypes
Update the mapping of Postgres 10 database types to class types for the schema framework.- Specified by:
updateClassTypes
in interfaceDatabaseJsonPlatform
- Parameters:
classTypeMapping
-Map
with mappings to be updated.
-
updateFieldTypes
Update the mapping of JSON class types to Postgres 10 database types for the schema framework.- Specified by:
updateFieldTypes
in interfaceDatabaseJsonPlatform
- Overrides:
updateFieldTypes
in classJsonPlatform
- Parameters:
fieldTypeMapping
-Map
with mappings to be updated.
-
convertJsonValueToDataValue
INTERNAL: Convert JSON value field to JDBC statement type. Postgres JSON storage type isJSONB
and target Java type isPGobject
.- Overrides:
convertJsonValueToDataValue
in classJsonPlatform
- Type Parameters:
T
- classification type- Parameters:
jsonValue
- source JSON value field- Returns:
- converted JDBC statement type
- Throws:
PersistenceException
-
getJsonDataFromResultSet
public <T> T getJsonDataFromResultSet(ResultSet resultSet, int columnNumber, Class<T> type) throws SQLException Retrieve JSON data from JDBCResultSet
. JSON data retrieved from Postgres JDBCResultSet
are returned asPGobject
instance. It must be converted toString
first to be accepted by commonJsonTypeConverter
.- Specified by:
getJsonDataFromResultSet
in interfaceDatabaseJsonPlatform
- Type Parameters:
T
- target type to return- Parameters:
resultSet
- source JDBCResultSet
columnNumber
- index of column in JDBCResultSet
type
- target class to return, this class will be used to cast returned value- Returns:
- JSON data from JDBC
ResultSet
asString
to be parsed by commonJsonTypeConverter
- Throws:
SQLException
- if data could not be retrieved
-
isPgObjectInstance
Check whether provided instance is an instance ofPGobject
.- Specified by:
isPgObjectInstance
in interfacePostgreSQL10Platform.PostgreSQL10JsonExtension
- Parameters:
parameter
- an instance to check- Returns:
- value of
true
when provided instance is an instance ofPGobject
orfalse
otherwise
-