Top Description Inners Fields Constructors Methods
org.hibernate.engine.jdbc

public Class ContextualLobCreator

extends AbstractLobCreator
implements LobCreator
Class Inheritance
All Implemented Interfaces
org.hibernate.engine.jdbc.LobCreator
Imports
java.sql.Blob, .SQLException, .Clob, .Connection, java.io.InputStream, .OutputStream, .IOException, .Reader, .Writer, java.lang.reflect.Method, .InvocationTargetException, org.hibernate.HibernateException, .JDBCException

LobCreator implementation using contextual creation against the JDBC java.sql.Connection class's LOB creation methods.
Authors
Steve Ebersole, Gail Badner

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private static final LobCreationContext.Callback
private static final LobCreationContext.Callback
private static final LobCreationContext.Callback
private static final Object[]
private static final Class<T>[]
private LobCreationContext

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Blob

Returns:

The created BLOB reference.
createBlob
()

Create the basic contextual BLOB reference.

public Blob
createBlob(byte[]
The byte array to wrap as a blob.
bytes
)

Implements org.hibernate.engine.jdbc.LobCreator.createBlob.

Create a BLOB reference encapsulating the given byte array.
public Blob
createBlob(InputStream
The binary stream to wrap as a blob.
inputStream
,
long
The length of the stream.
length
)

Implements org.hibernate.engine.jdbc.LobCreator.createBlob.

Create a BLOB reference encapsulating the given binary stream.
public Clob

Returns:

The created CLOB reference.
createClob
()

Create the basic contextual CLOB reference.

public Clob
createClob(String
The String to wrap as a clob.
string
)

Implements org.hibernate.engine.jdbc.LobCreator.createClob.

Create a CLOB reference encapsulating the given String data.
public Clob
createClob(Reader
The character data reader.
reader
,
long
The length of the reader data.
length
)

Implements org.hibernate.engine.jdbc.LobCreator.createClob.

Create a CLOB reference encapsulating the given character data.
public Clob

Returns:

The created NCLOB reference.
createNClob
()

Create the basic contextual NCLOB reference.

public Clob
createNClob(String
The String to wrap as a NCLOB.
string
)

Implements org.hibernate.engine.jdbc.LobCreator.createNClob.

Create a NCLOB reference encapsulating the given String data.
public Clob
createNClob(Reader
The character data reader.
reader
,
long
The length of the reader data.
length
)

Implements org.hibernate.engine.jdbc.LobCreator.createNClob.

Create a NCLOB reference encapsulating the given character data.
private static Method
Inherited from org.hibernate.engine.jdbc.AbstractLobCreator:
wrapwrap

Field Detail

CREATE_BLOB_CALLBACKback to summary
private static final LobCreationContext.Callback CREATE_BLOB_CALLBACK
CREATE_CLOB_CALLBACKback to summary
private static final LobCreationContext.Callback CREATE_CLOB_CALLBACK
CREATE_NCLOB_CALLBACKback to summary
private static final LobCreationContext.Callback CREATE_NCLOB_CALLBACK
CREATION_METHOD_ARGSback to summary
private static final Object[] CREATION_METHOD_ARGS
CREATION_METHOD_SIGback to summary
private static final Class<T>[] CREATION_METHOD_SIG
lobCreationContextback to summary
private LobCreationContext lobCreationContext

Constructor Detail

ContextualLobCreatorback to summary
public ContextualLobCreator(LobCreationContext lobCreationContext)

Method Detail

createBlobback to summary
public Blob createBlob()

Create the basic contextual BLOB reference.

Returns:Blob

The created BLOB reference.

createBlobback to summary
public Blob createBlob(byte[] bytes)

Implements org.hibernate.engine.jdbc.LobCreator.createBlob.

Doc from org.hibernate.engine.jdbc.LobCreator.createBlob.

Create a BLOB reference encapsulating the given byte array.

Parameters
bytes:byte[]

The byte array to wrap as a blob.

Returns:Blob

The created blob, castable to Blob as well as BlobImplementer

createBlobback to summary
public Blob createBlob(InputStream inputStream, long length)

Implements org.hibernate.engine.jdbc.LobCreator.createBlob.

Doc from org.hibernate.engine.jdbc.LobCreator.createBlob.

Create a BLOB reference encapsulating the given binary stream.

Parameters
inputStream:InputStream

The binary stream to wrap as a blob.

length:long

The length of the stream.

Returns:Blob

The created blob, castable to Blob as well as BlobImplementer

createClobback to summary
public Clob createClob()

Create the basic contextual CLOB reference.

Returns:Clob

The created CLOB reference.

createClobback to summary
public Clob createClob(String string)

Implements org.hibernate.engine.jdbc.LobCreator.createClob.

Doc from org.hibernate.engine.jdbc.LobCreator.createClob.

Create a CLOB reference encapsulating the given String data.

Parameters
string:String

The String to wrap as a clob.

Returns:Clob

The created clob, castable to Clob as well as ClobImplementer

createClobback to summary
public Clob createClob(Reader reader, long length)

Implements org.hibernate.engine.jdbc.LobCreator.createClob.

Doc from org.hibernate.engine.jdbc.LobCreator.createClob.

Create a CLOB reference encapsulating the given character data.

Parameters
reader:Reader

The character data reader.

length:long

The length of the reader data.

Returns:Clob

The created clob, castable to Clob as well as ClobImplementer

createNClobback to summary
public Clob createNClob()

Create the basic contextual NCLOB reference.

Returns:Clob

The created NCLOB reference.

createNClobback to summary
public Clob createNClob(String string)

Implements org.hibernate.engine.jdbc.LobCreator.createNClob.

Doc from org.hibernate.engine.jdbc.LobCreator.createNClob.

Create a NCLOB reference encapsulating the given String data.

Parameters
string:String

The String to wrap as a NCLOB.

Returns:Clob

The created NCLOB, castable as Clob as well as NClobImplementer. In JDK 1.6 environments, also castable to java.sql.NClob

createNClobback to summary
public Clob createNClob(Reader reader, long length)

Implements org.hibernate.engine.jdbc.LobCreator.createNClob.

Doc from org.hibernate.engine.jdbc.LobCreator.createNClob.

Create a NCLOB reference encapsulating the given character data.

Parameters
reader:Reader

The character data reader.

length:long

The length of the reader data.

Returns:Clob

The created NCLOB, castable as Clob as well as NClobImplementer. In JDK 1.6 environments, also castable to java.sql.NClob

getConnectionlobCreationMethodback to summary
private static Method getConnectionlobCreationMethod(String methodName)
org.hibernate.engine.jdbc back to summary

private Class ContextualLobCreator.CallbackImpl

extends Object
implements Callback
Class Inheritance
All Implemented Interfaces
org.hibernate.engine.jdbc.LobCreationContext.Callback

Field Summary

Modifier and TypeField and Description
private final Method

Constructor Summary

AccessConstructor and Description
private
CallbackImpl(Method creationMethod)

Method Summary

Modifier and TypeMethod and Description
public Object
executeOnConnection(Connection
The JDBC Connection.
connection
)

Implements org.hibernate.engine.jdbc.LobCreationContext.Callback.executeOnConnection.

Perform whatever actions are necessary using the provided JDBC Connection.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

creationMethodback to summary
private final Method creationMethod

Constructor Detail

CallbackImplback to summary
private CallbackImpl(Method creationMethod)

Method Detail

executeOnConnectionback to summary
public Object executeOnConnection(Connection connection) throws SQLException

Implements org.hibernate.engine.jdbc.LobCreationContext.Callback.executeOnConnection.

Doc from org.hibernate.engine.jdbc.LobCreationContext.Callback.executeOnConnection.

Perform whatever actions are necessary using the provided JDBC Connection.

Parameters
connection:Connection

The JDBC Connection.

Returns:Object

The created LOB.