Top Description 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.io.InputStream, .Reader, java.sql.Blob, .Clob, .Connection, .NClob, .SQLException, org.hibernate.JDBCException

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

Field Summary

Modifier and TypeField and Description
public static final LobCreationContext.Callback<Blob>
CREATE_BLOB_CALLBACK

Callback for performing contextual BLOB creation

public static final LobCreationContext.Callback<Clob>
CREATE_CLOB_CALLBACK

Callback for performing contextual CLOB creation

public static final LobCreationContext.Callback<NClob>
CREATE_NCLOB_CALLBACK

Callback for performing contextual NCLOB creation

private LobCreationContext

Constructor Summary

AccessConstructor and Description
public
ContextualLobCreator(LobCreationContext
The context for performing LOB creation
lobCreationContext
)

Constructs a ContextualLobCreator

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 NClob

Returns:

The created NCLOB reference.
createNClob
()

Create the basic contextual NCLOB reference.

public NClob
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 NClob
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.
Inherited from org.hibernate.engine.jdbc.AbstractLobCreator:
wrapwrapwrap

Field Detail

CREATE_BLOB_CALLBACKback to summary
public static final LobCreationContext.Callback<Blob> CREATE_BLOB_CALLBACK

Callback for performing contextual BLOB creation

CREATE_CLOB_CALLBACKback to summary
public static final LobCreationContext.Callback<Clob> CREATE_CLOB_CALLBACK

Callback for performing contextual CLOB creation

CREATE_NCLOB_CALLBACKback to summary
public static final LobCreationContext.Callback<NClob> CREATE_NCLOB_CALLBACK

Callback for performing contextual NCLOB creation

lobCreationContextback to summary
private LobCreationContext lobCreationContext

Constructor Detail

ContextualLobCreatorback to summary
public ContextualLobCreator(LobCreationContext lobCreationContext)

Constructs a ContextualLobCreator

Parameters
lobCreationContext:LobCreationContext

The context for performing LOB creation

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

Annotations
@Override
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

Annotations
@Override
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

Annotations
@Override
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

Annotations
@Override
createNClobback to summary
public NClob createNClob()

Create the basic contextual NCLOB reference.

Returns:NClob

The created NCLOB reference.

createNClobback to summary
public NClob 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:NClob

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

Annotations
@Override
createNClobback to summary
public NClob 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:NClob

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

Annotations
@Override