Module eclipselink

Class Oracle21JsonPlatform

java.lang.Object
org.eclipse.persistence.json.JsonPlatform
org.eclipse.persistence.platform.database.oracle.json.Oracle21JsonPlatform
All Implemented Interfaces:
org.eclipse.persistence.internal.databaseaccess.DatabaseJsonPlatform

public class Oracle21JsonPlatform extends org.eclipse.persistence.json.JsonPlatform
Oracle 21c JSON database platform.
  • Constructor Details

    • Oracle21JsonPlatform

      public Oracle21JsonPlatform()
  • Method Details

    • updateClassTypes

      public void updateClassTypes(Map<String,Class<?>> classTypeMapping)
      Update the mapping of Oracle 21c database types to class types for the schema framework.
      Parameters:
      classTypeMapping - Map with mappings to be updated.
    • updateFieldTypes

      public void updateFieldTypes(Map<Class<?>,FieldDefinition.DatabaseType> fieldTypeMapping)
      Update the mapping of JSON class types to Oracle 21c database types for the schema framework.
      Specified by:
      updateFieldTypes in interface org.eclipse.persistence.internal.databaseaccess.DatabaseJsonPlatform
      Overrides:
      updateFieldTypes in class org.eclipse.persistence.json.JsonPlatform
      Parameters:
      fieldTypeMapping - Map with mappings to be updated.
    • convertJsonValueToDataValue

      public <T> T convertJsonValueToDataValue(jakarta.json.JsonValue jsonValue) throws jakarta.persistence.PersistenceException
      INTERNAL: Convert JSON value field to JDBC statement type. Postgres JSON storage type is JSONB and target Java type is PGobject.
      Overrides:
      convertJsonValueToDataValue in class org.eclipse.persistence.json.JsonPlatform
      Type Parameters:
      T - classification type
      Parameters:
      jsonValue - source JSON value field
      Returns:
      converted JDBC statement type
      Throws:
      jakarta.persistence.PersistenceException
    • convertDataValueToJsonValue

      public jakarta.json.JsonValue convertDataValueToJsonValue(Object jdbcValue)
      INTERNAL: Convert JDBC ResultSet type to JSON value field.
      Overrides:
      convertDataValueToJsonValue in class org.eclipse.persistence.json.JsonPlatform
      Parameters:
      jdbcValue - source classification type value from JDBC
      Returns:
      converted JSON field value
    • getJsonDataFromResultSet

      public <T> T getJsonDataFromResultSet(ResultSet resultSet, int columnNumber, Class<T> type) throws SQLException
      Retrieve JSON data from JDBC ResultSet. JSON data retrieved from Postgres JDBC ResultSet are returned as OracleJsonValue instance. JsonTypeConverter will convert OracleJsonValue to JsonValue.
      Type Parameters:
      T - target type to return
      Parameters:
      resultSet - source JDBC ResultSet
      columnNumber - index of column in JDBC ResultSet
      type - target class to return, this class will be used to cast returned value
      Returns:
      JSON data from JDBC ResultSet as String to be parsed by common JsonTypeConverter
      Throws:
      SQLException - if data could not be retrieved