Top Description Methods
org.eclipse.persistence.internal.databaseaccess

public Interface DatabaseJsonPlatform

Imports
java.lang.reflect.Type, java.sql.ResultSet, .SQLException, java.util.Hashtable, .Map

Database platform JSON extension. Provides an interface to implement JSON specific features.

Method Summary

Modifier and TypeMethod and Description
public default String

Returns:

JSON parameter marker in SQL expression for current database platform.
customParameterMarker
()

JSON parameter marker in SQL expression of PreparedStatement.

public default <
target type to return
T
>
T

Returns:

JSON data from JDBC ResultSet as String to be parsed by JsonTypeConverter
getJsonDataFromResultSet
(final ResultSet
source JDBC ResultSet
resultSet
,
final int
index of column in JDBC ResultSet
columnNumber
,
final Class<T>
target class to return, this class will be used to cast returned value
type
)

Retrieve JSON data from JDBC ResultSet.

public default boolean

Returns:

value of true when provide type implements jakarta.json.JsonValue interface or false otherwose
isJsonType
(final Type
tyoe to be checked
type
)

Check whether provided Type is JSON type.

public default <
target type to unwrap
T
>
T

Returns:

this DatabaseJsonPlatform instance as provided class
unwrap
(final Class<T>
target class to unwrap, this class will be used to cast returned value
type
)

Unwrap this DatabaseJsonPlatform instance as provided class.

public default void
updateClassTypes(final Map<String, Class<?>>
Map with mappings to be updated.
classTypeMapping
)

Update the mapping of class types to database types for the schema framework.

public default void
updateFieldTypes(final Hashtable<Class<?>, FieldTypeDefinition>
Map with mappings to be updated.
fieldTypeMapping
)

Update the mapping of database types to class types for the schema framework.

Method Detail

customParameterMarkerback to summary
public default String customParameterMarker()

JSON parameter marker in SQL expression of PreparedStatement. Default value is SQL parameter placeholder character ?.

Returns:String

JSON parameter marker in SQL expression for current database platform.

getJsonDataFromResultSetback to summary
public default <T> T getJsonDataFromResultSet(final ResultSet resultSet, final int columnNumber, final Class<T> type) throws SQLException

Retrieve JSON data from JDBC ResultSet.

Parameters
<T>
target type to return
resultSet:ResultSet

source JDBC ResultSet

columnNumber:int

index of column in JDBC ResultSet

type:Class<T>

target class to return, this class will be used to cast returned value

Returns:T

JSON data from JDBC ResultSet as String to be parsed by JsonTypeConverter

Exceptions
SQLException:
if data could not be retrieved
isJsonTypeback to summary
public default boolean isJsonType(final Type type)

Check whether provided Type is JSON type. JSON type is any class that implements jakarta.json.JsonValue interface. Default implementation always returns false, because jakarta.json.JsonValue interface is not supported in core module without extensions.

Parameters
type:Type

tyoe to be checked

Returns:boolean

value of true when provide type implements jakarta.json.JsonValue interface or false otherwose

unwrapback to summary
public default <T> T unwrap(final Class<T> type)

Unwrap this DatabaseJsonPlatform instance as provided class.

Parameters
<T>
target type to unwrap
type:Class<T>

target class to unwrap, this class will be used to cast returned value

Returns:T

this DatabaseJsonPlatform instance as provided class

Exceptions
IllegalArgumentException:
when unwrap of this DatabaseJsonPlatform instance is not possible
updateClassTypesback to summary
public default void updateClassTypes(final Map<String, Class<?>> classTypeMapping)

Update the mapping of class types to database types for the schema framework.

Parameters
classTypeMapping:Map<String, Class<?>>

Map with mappings to be updated.

updateFieldTypesback to summary
public default void updateFieldTypes(final Hashtable<Class<?>, FieldTypeDefinition> fieldTypeMapping)

Update the mapping of database types to class types for the schema framework.

Parameters
fieldTypeMapping:Hashtable<Class<?>, FieldTypeDefinition>

Map with mappings to be updated.