## org.hibernate.engine.jdbc
Class ContextualLobCreator

    java.lang.Object
      org.hibernate.engine.jdbc.AbstractLobCreator
          org.hibernate.engine.jdbc.ContextualLobCreator

All Implemented Interfaces:
  LobCreator

    public class ContextualLobCreator

extends AbstractLobCreator
implements LobCreator

`LobCreator` implementation using contextual creation against the JDBC `Connection` class's LOB creation methods.

Author:
  Steve Ebersole, Gail Badner

Constructor Summary
`ContextualLobCreator(LobCreationContext lobCreationContext)`

Method Summary
`Blob` `createBlob()` Create the basic contextual BLOB reference.
`Blob` `createBlob(byte[] bytes)` Create a BLOB reference encapsulating the given byte array.
`Blob` `createBlob(InputStream inputStream, long length)` Create a BLOB reference encapsulating the given binary stream.
`Clob` `createClob()` Create the basic contextual CLOB reference.
`Clob` `createClob(Reader reader, long length)` Create a CLOB reference encapsulating the given character data.
`Clob` `createClob(String string)` Create a CLOB reference encapsulating the given String data.
`Clob` `createNClob()` Create the basic contextual NCLOB reference.
`Clob` `createNClob(Reader reader, long length)` Create a NCLOB reference encapsulating the given character data.
`Clob` `createNClob(String string)` Create a NCLOB reference encapsulating the given String data.

Methods inherited from class org.hibernate.engine.jdbc.AbstractLobCreator
`wrap, wrap`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.hibernate.engine.jdbc.LobCreator
`wrap, wrap`

Constructor Detail

### ContextualLobCreator

    public ContextualLobCreator(LobCreationContext lobCreationContext)

Method Detail

### createBlob

    public Blob createBlob()

  Create the basic contextual BLOB reference.

  Returns:
    The created BLOB reference.

### createBlob

    public Blob createBlob(byte[] bytes)

  Create a BLOB reference encapsulating the given byte array.

  Specified by:
    `createBlob` in interface `LobCreator`
  Parameters:
    `bytes` - The byte array to wrap as a blob.
  Returns:
    The created blob, castable to `Blob` as well as `BlobImplementer`

### createBlob

    public Blob createBlob(InputStream inputStream,
                           long length)

  Create a BLOB reference encapsulating the given binary stream.

  Specified by:
    `createBlob` in interface `LobCreator`
  Parameters:
    `inputStream` - The binary stream to wrap as a blob.
    `length` - The length of the stream.
  Returns:
    The created blob, castable to `Blob` as well as `BlobImplementer`

### createClob

    public Clob createClob()

  Create the basic contextual CLOB reference.

  Returns:
    The created CLOB reference.

### createClob

    public Clob createClob(String string)

  Create a CLOB reference encapsulating the given String data.

  Specified by:
    `createClob` in interface `LobCreator`
  Parameters:
    `string` - The String to wrap as a clob.
  Returns:
    The created clob, castable to `Clob` as well as `ClobImplementer`

### createClob

    public Clob createClob(Reader reader,
                           long length)

  Create a CLOB reference encapsulating the given character data.

  Specified by:
    `createClob` in interface `LobCreator`
  Parameters:
    `reader` - The character data reader.
    `length` - The length of the reader data.
  Returns:
    The created clob, castable to `Clob` as well as `ClobImplementer`

### createNClob

    public Clob createNClob()

  Create the basic contextual NCLOB reference.

  Returns:
    The created NCLOB reference.

### createNClob

    public Clob createNClob(String string)

  Create a NCLOB reference encapsulating the given String data.

  Specified by:
    `createNClob` in interface `LobCreator`
  Parameters:
    `string` - The String to wrap as a NCLOB.
  Returns:
    The created NCLOB, castable as `Clob` as well as `NClobImplementer`. In JDK 1.6 environments, also castable to java.sql.NClob

### createNClob

    public Clob createNClob(Reader reader,
                            long length)

  Create a NCLOB reference encapsulating the given character data.

  Specified by:
    `createNClob` in interface `LobCreator`
  Parameters:
    `reader` - The character data reader.
    `length` - The length of the reader data.
  Returns:
    The created NCLOB, castable as `Clob` as well as `NClobImplementer`. In JDK 1.6 environments, also castable to java.sql.NClob

Copyright © 2001-2010 Red Hat, Inc. All Rights Reserved.