Class JsonPlatform

java.lang.Object
org.eclipse.persistence.json.JsonPlatform
All Implemented Interfaces:
DatabaseJsonPlatform
Direct Known Subclasses:
MySQLJsonPlatform, Oracle21JsonPlatform, PostgreSQL10JsonPlatform

public class JsonPlatform extends Object implements DatabaseJsonPlatform
Default JSON database platform.
  • Constructor Details

    • JsonPlatform

      public JsonPlatform()
  • Method Details

    • isJsonType

      public boolean isJsonType(Type type)
      Check whether provided Type instance is JSON type.
      Specified by:
      isJsonType in interface DatabaseJsonPlatform
      Parameters:
      type - type to be checked
      Returns:
      value of true when provided value is JSON type or false otherwise
    • updateFieldTypes

      public void updateFieldTypes(Hashtable<Class<?>,FieldTypeDefinition> fieldTypeMapping)
      Update the mapping of JSON class types to database types for the schema framework.
      Specified by:
      updateFieldTypes in interface DatabaseJsonPlatform
      Parameters:
      fieldTypeMapping - Map with mappings to be updated.
    • convertJsonValueToDataValue

      public <T> T convertJsonValueToDataValue(JsonValue jsonValue)
      INTERNAL: Convert JSON value field to JDBC statement type. Common JSON storage type is VARCHAR so target Java type is String.
      Type Parameters:
      T - classification type
      Parameters:
      jsonValue - source JSON value field
      Returns:
      converted JDBC statement type
    • convertDataValueToJsonValue

      public JsonValue convertDataValueToJsonValue(Object jdbcValue)
      Convert JDBC ResultSet type to JSON value field. This method consumes value returned by getJsonDataFromResultSet(ResultSet, int). Both methods must be overwritten by platform specific code when jdbcValue is not String.
      Parameters:
      jdbcValue - source classification type value from JDBC
      Returns:
      converted JSON field value