Top Description Fields Constructors Methods
org.hibernate.engine.jdbc.env.internal

public Class BlobAndClobCreator

extends AbstractLobCreator
implements LobCreator
Class Inheritance
All Implemented Interfaces
org.hibernate.engine.jdbc.LobCreator
Known Direct Subclasses
org.hibernate.engine.jdbc.env.internal.StandardLobCreator
Imports
java.io.InputStream, .Reader, java.sql.Blob, .Clob, .Connection, .NClob, .SQLException, org.hibernate.JDBCException, org.hibernate.engine.jdbc.AbstractLobCreator, .LobCreationContext, .LobCreator, .NClobProxy, .NonContextualLobCreator

LobCreator which can use Connection#createBlob and Connection#createClob, but java.sql.NClob references are created locally.
Author
Steve Ebersole
See Also
NClobProxy

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

protected final 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.
stream
,
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
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

lobCreationContextback to summary
protected final LobCreationContext lobCreationContext

Constructor Detail

BlobAndClobCreatorback to summary
public BlobAndClobCreator(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

Annotations
@Override
createBlobback to summary
public Blob createBlob(InputStream stream, 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
stream: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(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