Class JsonPlatform

  • All Implemented Interfaces:
    org.eclipse.persistence.internal.databaseaccess.DatabaseJsonPlatform
    Direct Known Subclasses:
    MySQLJsonPlatform

    public class JsonPlatform
    extends Object
    implements org.eclipse.persistence.internal.databaseaccess.DatabaseJsonPlatform
    Default JSON database platform.
    • Constructor Detail

      • JsonPlatform

        public JsonPlatform()
    • Method Detail

      • isJsonType

        public boolean isJsonType​(Type type)
        Check whether provided Type instance is JSON type.
        Specified by:
        isJsonType in interface org.eclipse.persistence.internal.databaseaccess.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<?>,​org.eclipse.persistence.internal.databaseaccess.FieldTypeDefinition> fieldTypeMapping)
        Update the mapping of JSON class types to database types for the schema framework.
        Specified by:
        updateFieldTypes in interface org.eclipse.persistence.internal.databaseaccess.DatabaseJsonPlatform
        Parameters:
        fieldTypeMapping - Map with mappings to be updated.
      • convertJsonValueToDataValue

        public <T> T convertJsonValueToDataValue​(jakarta.json.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 jakarta.json.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