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

public Class BindCallCustomParameter

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Known Direct Subclasses
org.eclipse.persistence.internal.databaseaccess.InParameterForCallableStatement, org.eclipse.persistence.internal.databaseaccess.OutputParameterForCallableStatement
Imports
java.io.Serializable, java.sql.PreparedStatement, .SQLException, .Array, .CallableStatement, .Struct, .Types, java.util.Arrays, .Collection, .Iterator, org.eclipse.persistence.internal.helper.DatabaseField, org.eclipse.persistence.mappings.DatabaseMapping.WriteType, org.eclipse.persistence.mappings.structures.ObjectRelationalDatabaseField, .ObjectRelationalDataTypeDescriptor, org.eclipse.persistence.descriptors.ClassDescriptor, org.eclipse.persistence.internal.sessions.AbstractRecord, .AbstractSession

INTERNAL:

Purpose: To provide a base type for customary parameters' types used for binding by DatabaseCall: descendants of DatabasePlatform may create instances of descendants of this class in customModifyInDatabaseCall method.

Responsibilities:

Field Summary

Modifier and TypeField and Description
protected Object

Constructor Summary

AccessConstructor and Description
public
BindCallCustomParameter(Object obj)

INTERNAL: Binds the custom parameter (obj) into the passed PreparedStatement for the passed DatabaseCall.

protected

Method Summary

Modifier and TypeMethod and Description
public Object
convert(Object parameter, DatabaseField dbField, AbstractSession session, Connection connection)

INTERNAL: Converts the parameter object from a collection or java object into a JDBC type such as an Array or Struct object, based on the type information contained in the dbField object.

public void
set(DatabasePlatform platform, PreparedStatement statement, int parameterIndex, AbstractSession session)

Sets this bound parameter, on the given statement, at the given parameterIndex.

public void
set(DatabasePlatform platform, CallableStatement statement, String parameterName, AbstractSession session)

Sets this bound parameter, on the given statement, for the given parameterName.

public boolean
shouldUseUnwrappedConnection()

Return if unwrapped connection should be used.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

objback to summary
protected Object obj

Constructor Detail

BindCallCustomParameterback to summary
public BindCallCustomParameter(Object obj)

INTERNAL: Binds the custom parameter (obj) into the passed PreparedStatement for the passed DatabaseCall. Called only by DatabasePlatform.setParameterValueInDatabaseCall method

BindCallCustomParameterback to summary
protected BindCallCustomParameter()

Method Detail

convertback to summary
public Object convert(Object parameter, DatabaseField dbField, AbstractSession session, Connection connection) throws SQLException

INTERNAL: Converts the parameter object from a collection or java object into a JDBC type such as an Array or Struct object, based on the type information contained in the dbField object. If the parameter is null, the dbField will be returned to represent the null value. A Struct object will be returned if: 1) the dbField is an ObjectRelationalDatabaseField with its sqltype set to Types.STRUCT 2) parameter is not an instanceof java.sql.Struct 3) There is an ObjectRelationalDataTypeDescriptor defined for the parameter object's class An Array object will be returned if: 1) the dbField is an ObjectRelationalDatabaseField and sqltype is set to Types.ARRAY 2) parameter is an instanceof collection and is not an instanceof java.sql.Array This method will be used recursively on the dbField's nestedField and objects in the collection to build the Array object, allowing for nested structures to be produced ie arrays of arrays

setback to summary
public void set(DatabasePlatform platform, PreparedStatement statement, int parameterIndex, AbstractSession session) throws SQLException

Sets this bound parameter, on the given statement, at the given parameterIndex.

Note

java.sql.PreparedStatement contains setX(int parameterIndex, X x) methods. This method aligns with that pattern.

setback to summary
public void set(DatabasePlatform platform, CallableStatement statement, String parameterName, AbstractSession session) throws SQLException

Sets this bound parameter, on the given statement, for the given parameterName.

Note

java.sql.CallableStatement contains setX(int parameterName, X x) methods. This method aligns with that pattern.

shouldUseUnwrappedConnectionback to summary
public boolean shouldUseUnwrappedConnection()

Return if unwrapped connection should be used.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override