Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.hibernate
Class Hibernate

    java.lang.Object
      org.hibernate.Hibernate

    public final class Hibernate

extends Object

- Provides access to the full range of Hibernate built-in types. `Type` instances may be used to bind values to query parameters.
- A factory for new `Blob`s and `Clob`s.
- Defines static methods for manipulation of proxies.

Author:
  Gavin King
See Also:
  `Clob`, `Blob`, `Type`

Field Summary
`static BigDecimalType` | `BIG_DECIMAL` Deprecated. Use `StandardBasicTypes.BIG_DECIMAL` instead.
`static BigIntegerType` | `BIG_INTEGER` Deprecated. Use `StandardBasicTypes.BIG_INTEGER` instead.
`static BinaryType` | `BINARY` Deprecated. Use `StandardBasicTypes.BINARY` instead.
`static BlobType` | `BLOB` Deprecated. Use `StandardBasicTypes.BLOB` instead.
`static BooleanType` | `BOOLEAN` Deprecated. Use `StandardBasicTypes.BOOLEAN` instead.
`static ByteType` | `BYTE` Deprecated. Use `StandardBasicTypes.BYTE` instead.
`static CalendarType` | `CALENDAR` Deprecated. Use `StandardBasicTypes.CALENDAR` instead.
`static CalendarDateType` | `CALENDAR_DATE` Deprecated. Use `StandardBasicTypes.CALENDAR_DATE` instead.
`static CharArrayType` | `CHAR_ARRAY` Deprecated. Use `StandardBasicTypes.CHAR_ARRAY` instead.
`static CharacterType` | `CHARACTER` Deprecated. Use `StandardBasicTypes.CHARACTER` instead.
`static CharacterArrayType` | `CHARACTER_ARRAY` Deprecated. Use `StandardBasicTypes.CHARACTER_ARRAY` instead.
`static PrimitiveCharacterArrayClobType` | `CHARACTERS_CLOB` Deprecated. Use `StandardBasicTypes.CHARACTERS_CLOB` instead.
`static ClassType` | `CLASS` Deprecated. Use `StandardBasicTypes.CLASS` instead.
`static ClobType` | `CLOB` Deprecated. Use `StandardBasicTypes.CLOB` instead.
`static CurrencyType` | `CURRENCY` Deprecated. Use `StandardBasicTypes.CURRENCY` instead.
`static DateType` | `DATE` Deprecated. Use `StandardBasicTypes.DATE` instead.
`static DoubleType` | `DOUBLE` Deprecated. Use `StandardBasicTypes.DOUBLE` instead.
`static FloatType` | `FLOAT` Deprecated. Use `StandardBasicTypes.FLOAT` instead.
`static ImageType` | `IMAGE` Deprecated. Use `StandardBasicTypes.IMAGE` instead.
`static IntegerType` | `INTEGER` Deprecated. Use `StandardBasicTypes.INTEGER` instead.
`static LocaleType` | `LOCALE` Deprecated. Use `StandardBasicTypes.LOCALE` instead.
`static LongType` | `LONG` Deprecated. Use `StandardBasicTypes.LONG` instead.
`static MaterializedBlobType` | `MATERIALIZED_BLOB` Deprecated. Use `StandardBasicTypes.MATERIALIZED_BLOB` instead.
`static MaterializedClobType` | `MATERIALIZED_CLOB` Deprecated. Use `StandardBasicTypes.MATERIALIZED_CLOB` instead.
`static ObjectType` | `OBJECT` Deprecated. Use `ObjectType.INSTANCE` instead.
`static SerializableType` | `SERIALIZABLE` Deprecated. Use `StandardBasicTypes.SERIALIZABLE` instead.
`static ShortType` | `SHORT` Deprecated. Use `StandardBasicTypes.SHORT` instead.
`static StringType` | `STRING` Deprecated. Use `StandardBasicTypes.STRING` instead.
`static TextType` | `TEXT` Deprecated. Use `StandardBasicTypes.TEXT` instead.
`static TimeType` | `TIME` Deprecated. Use `StandardBasicTypes.TIME` instead.
`static TimestampType` | `TIMESTAMP` Deprecated. Use `StandardBasicTypes.TIMESTAMP` instead.
`static TimeZoneType` | `TIMEZONE` Deprecated. Use `StandardBasicTypes.TIMEZONE` instead.
`static TrueFalseType` | `TRUE_FALSE` Deprecated. Use `StandardBasicTypes.TRUE_FALSE` instead.
`static WrapperBinaryType` | `WRAPPER_BINARY` Deprecated. Use `StandardBasicTypes.WRAPPER_BINARY` instead.
`static CharacterArrayClobType` | `WRAPPER_CHARACTERS_CLOB` Deprecated. Use `StandardBasicTypes.WRAPPER_CHARACTERS_CLOB` instead.
`static WrappedMaterializedBlobType` | `WRAPPER_MATERIALIZED_BLOB` Deprecated. Use `StandardBasicTypes.WRAPPER_MATERIALIZED_BLOB` instead.
`static YesNoType` | `YES_NO` Deprecated. Use `StandardBasicTypes.YES_NO` instead.

Method Summary
`static Type` | `any(Type metaType, Type identifierType)` Deprecated. Use `TypeHelper.any(org.hibernate.type.Type, org.hibernate.type.Type)` instead.
`static void` | `close(Iterator iterator)` Close an `Iterator` created by `iterate()` immediately, instead of waiting until the session is closed or disconnected.
`static Blob` | `createBlob(byte[] bytes)` Deprecated. Use `LobHelper.createBlob(byte[])` instead.
`static Blob` | `createBlob(byte[] bytes, Session session)` Deprecated. Use `LobHelper.createBlob(byte[])` instead on the `LobHelper` obtained from `Session.getLobHelper()`
`static Blob` | `createBlob(InputStream stream)` Deprecated. With no direct replacement. Use `createBlob(InputStream,long)` instead, passing in the length
`static Blob` | `createBlob(InputStream stream, int length)` Deprecated. Use `LobHelper.createBlob(InputStream, long)` instead.
`static Blob` | `createBlob(InputStream stream, long length)` Deprecated. Use `LobHelper.createBlob(InputStream, long)` instead.
`static Blob` | `createBlob(InputStream stream, long length, Session session)` Deprecated. Use `LobHelper.createBlob(InputStream, long)` instead.
`static Clob` | `createClob(Reader reader, int length)` Deprecated. Use `LobHelper.createClob(Reader, long)` instead
`static Clob` | `createClob(Reader reader, long length)` Deprecated. Use `LobHelper.createClob(Reader, long)` instead
`static Clob` | `createClob(Reader reader, long length, Session session)` Deprecated. Use `LobHelper.createClob(Reader, long)` instead
`static Clob` | `createClob(String string)` Deprecated. Use `LobHelper.createClob(String)` instead
`static Clob` | `createClob(String string, Session session)` Deprecated. Use `LobHelper.createClob(String)` instead on the `LobHelper` obtained from `Session.getLobHelper()`
`static Type` | `custom(Class userTypeClass)` Deprecated. Use `TypeHelper.custom(java.lang.Class)` instead; see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182
`static Type` | `custom(Class userTypeClass, Properties parameters)` Deprecated. Use `TypeHelper.custom(java.lang.Class)` instead; see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182
`static Type` | `custom(Class userTypeClass, String[] parameterNames, String[] parameterValues)` Deprecated. Use `TypeHelper.custom(java.lang.Class)` instead; see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182
`static Type` | `entity(Class persistentClass)` Deprecated. Use `TypeHelper.entity(java.lang.Class)` instead; see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182
`static Type` | `entity(String entityName)` Deprecated. Use `TypeHelper.entity(java.lang.Class)` instead; see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182
`static Class` | `getClass(Object proxy)` Get the true, underlying class of a proxied persistent class.
`static LobCreator` | `getLobCreator(Session session)`
`static LobCreator` | `getLobCreator(SessionImplementor session)`
`static void` | `initialize(Object proxy)` Force initialization of a proxy or persistent collection.
`static boolean` | `isInitialized(Object proxy)` Check if the proxy or persistent collection is initialized.
`static boolean` | `isPropertyInitialized(Object proxy, String propertyName)` Check if the property is initialized.
`static Type` | `serializable(Class serializableClass)` Deprecated. Use `SerializableType.SerializableType(java.lang.Class)` instead.

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

Field Detail

### BOOLEAN

    public static final BooleanType BOOLEAN

  Deprecated. Use `StandardBasicTypes.BOOLEAN` instead.
  Hibernate `boolean` type.

### TRUE_FALSE

    public static final TrueFalseType TRUE_FALSE

  Deprecated. Use `StandardBasicTypes.TRUE_FALSE` instead.
  Hibernate `true_false` type.

### YES_NO

    public static final YesNoType YES_NO

  Deprecated. Use `StandardBasicTypes.YES_NO` instead.
  Hibernate `yes_no` type.

### BYTE

    public static final ByteType BYTE

  Deprecated. Use `StandardBasicTypes.BYTE` instead.
  Hibernate `byte` type.

### SHORT

    public static final ShortType SHORT

  Deprecated. Use `StandardBasicTypes.SHORT` instead.
  Hibernate `short` type.

### INTEGER

    public static final IntegerType INTEGER

  Deprecated. Use `StandardBasicTypes.INTEGER` instead.
  Hibernate `integer` type.

### LONG

    public static final LongType LONG

  Deprecated. Use `StandardBasicTypes.LONG` instead.
  Hibernate `long` type.

### FLOAT

    public static final FloatType FLOAT

  Deprecated. Use `StandardBasicTypes.FLOAT` instead.
  Hibernate `float` type.

### DOUBLE

    public static final DoubleType DOUBLE

  Deprecated. Use `StandardBasicTypes.DOUBLE` instead.
  Hibernate `double` type.

### BIG_INTEGER

    public static final BigIntegerType BIG_INTEGER

  Deprecated. Use `StandardBasicTypes.BIG_INTEGER` instead.
  Hibernate `big_integer` type.

### BIG_DECIMAL

    public static final BigDecimalType BIG_DECIMAL

  Deprecated. Use `StandardBasicTypes.BIG_DECIMAL` instead.
  Hibernate `big_decimal` type.

### CHARACTER

    public static final CharacterType CHARACTER

  Deprecated. Use `StandardBasicTypes.CHARACTER` instead.
  Hibernate `character` type.

### STRING

    public static final StringType STRING

  Deprecated. Use `StandardBasicTypes.STRING` instead.
  Hibernate `string` type.

### TIME

    public static final TimeType TIME

  Deprecated. Use `StandardBasicTypes.TIME` instead.
  Hibernate `time` type.

### DATE

    public static final DateType DATE

  Deprecated. Use `StandardBasicTypes.DATE` instead.
  Hibernate `date` type.

### TIMESTAMP

    public static final TimestampType TIMESTAMP

  Deprecated. Use `StandardBasicTypes.TIMESTAMP` instead.
  Hibernate `timestamp` type.

### BINARY

    public static final BinaryType BINARY

  Deprecated. Use `StandardBasicTypes.BINARY` instead.
  Hibernate `binary` type.

### WRAPPER_BINARY

    public static final WrapperBinaryType WRAPPER_BINARY

  Deprecated. Use `StandardBasicTypes.WRAPPER_BINARY` instead.
  Hibernate `wrapper-binary` type.

### CHAR_ARRAY

    public static final CharArrayType CHAR_ARRAY

  Deprecated. Use `StandardBasicTypes.CHAR_ARRAY` instead.
  Hibernate char[] type.

### CHARACTER_ARRAY

    public static final CharacterArrayType CHARACTER_ARRAY

  Deprecated. Use `StandardBasicTypes.CHARACTER_ARRAY` instead.
  Hibernate Character[] type.

### IMAGE

    public static final ImageType IMAGE

  Deprecated. Use `StandardBasicTypes.IMAGE` instead.
  Hibernate `image` type.

### TEXT

    public static final TextType TEXT

  Deprecated. Use `StandardBasicTypes.TEXT` instead.
  Hibernate `text` type.

### MATERIALIZED_BLOB

    public static final MaterializedBlobType MATERIALIZED_BLOB

  Deprecated. Use `StandardBasicTypes.MATERIALIZED_BLOB` instead.
  Hibernate `materialized_blob` type.

### MATERIALIZED_CLOB

    public static final MaterializedClobType MATERIALIZED_CLOB

  Deprecated. Use `StandardBasicTypes.MATERIALIZED_CLOB` instead.
  Hibernate `materialized_clob` type.

### BLOB

    public static final BlobType BLOB

  Deprecated. Use `StandardBasicTypes.BLOB` instead.
  Hibernate `blob` type.

### CLOB

    public static final ClobType CLOB

  Deprecated. Use `StandardBasicTypes.CLOB` instead.
  Hibernate `clob` type.

### WRAPPER_MATERIALIZED_BLOB

    public static final WrappedMaterializedBlobType WRAPPER_MATERIALIZED_BLOB

  Deprecated. Use `StandardBasicTypes.WRAPPER_MATERIALIZED_BLOB` instead.
  Hibernate `wrapper_materialized_blob` type.

### WRAPPER_CHARACTERS_CLOB

    public static final CharacterArrayClobType WRAPPER_CHARACTERS_CLOB

  Deprecated. Use `StandardBasicTypes.WRAPPER_CHARACTERS_CLOB` instead.
  Hibernate `wrapper_characters_clob` type.

### CHARACTERS_CLOB

    public static final PrimitiveCharacterArrayClobType CHARACTERS_CLOB

  Deprecated. Use `StandardBasicTypes.CHARACTERS_CLOB` instead.
  Hibernate `characters_clob` type.

### CALENDAR

    public static final CalendarType CALENDAR

  Deprecated. Use `StandardBasicTypes.CALENDAR` instead.
  Hibernate `calendar` type.

### CALENDAR_DATE

    public static final CalendarDateType CALENDAR_DATE

  Deprecated. Use `StandardBasicTypes.CALENDAR_DATE` instead.
  Hibernate `calendar_date` type.

### LOCALE

    public static final LocaleType LOCALE

  Deprecated. Use `StandardBasicTypes.LOCALE` instead.
  Hibernate `locale` type.

### CURRENCY

    public static final CurrencyType CURRENCY

  Deprecated. Use `StandardBasicTypes.CURRENCY` instead.
  Hibernate `currency` type.

### TIMEZONE

    public static final TimeZoneType TIMEZONE

  Deprecated. Use `StandardBasicTypes.TIMEZONE` instead.
  Hibernate `timezone` type.

### CLASS

    public static final ClassType CLASS

  Deprecated. Use `StandardBasicTypes.CLASS` instead.
  Hibernate `class` type.

### SERIALIZABLE

    public static final SerializableType SERIALIZABLE

  Deprecated. Use `StandardBasicTypes.SERIALIZABLE` instead.
  Hibernate `serializable` type.

### OBJECT

    public static final ObjectType OBJECT

  Deprecated. Use `ObjectType.INSTANCE` instead.
  Hibernate `object` type.

Method Detail

### serializable

    public static Type serializable(Class serializableClass)

  Deprecated. Use `SerializableType.SerializableType(java.lang.Class)` instead.

  A Hibernate `serializable` type.

  Parameters:
    `serializableClass` - The `Serializable` implementor class.
  Returns:

### any

    public static Type any(Type metaType,
                           Type identifierType)

  Deprecated. Use `TypeHelper.any(org.hibernate.type.Type, org.hibernate.type.Type)` instead.

  DO NOT USE!

### entity

    public static Type entity(Class persistentClass)

  Deprecated. Use `TypeHelper.entity(java.lang.Class)` instead; see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182

  DO NOT USE!

### entity

    public static Type entity(String entityName)

  Deprecated. Use `TypeHelper.entity(java.lang.Class)` instead; see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182

  DO NOT USE!

### custom

    public static Type custom(Class userTypeClass)

  Deprecated. Use `TypeHelper.custom(java.lang.Class)` instead; see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182

  DO NOT USE!

### custom

    public static Type custom(Class userTypeClass,
                              String[] parameterNames,
                              String[] parameterValues)

  Deprecated. Use `TypeHelper.custom(java.lang.Class)` instead; see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182

  DO NOT USE!

### custom

    public static Type custom(Class userTypeClass,
                              Properties parameters)

  Deprecated. Use `TypeHelper.custom(java.lang.Class)` instead; see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182

  DO NOT USE!

### initialize

    public static void initialize(Object proxy)
                           throws HibernateException

  Force initialization of a proxy or persistent collection.

  Note: This only ensures intialization of a proxy object or collection; it is not guaranteed that the elements INSIDE the collection will be initialized/materialized.

  Parameters:
    `proxy` - a persistable object, proxy, persistent collection or `null`
  Throws:
    `HibernateException` - if we can't initialize the proxy at this time, eg. the `Session` was closed

### isInitialized

    public static boolean isInitialized(Object proxy)

  Check if the proxy or persistent collection is initialized.

  Parameters:
    `proxy` - a persistable object, proxy, persistent collection or `null`
  Returns:
    true if the argument is already initialized, or is not a proxy or collection

### getClass

    public static Class getClass(Object proxy)

  Get the true, underlying class of a proxied persistent class. This operation will initialize a proxy by side-effect.

  Parameters:
    `proxy` - a persistable object or proxy
  Returns:
    the true class of the instance
  Throws:
    `HibernateException`

### createBlob

    public static Blob createBlob(byte[] bytes)

  Deprecated. Use `LobHelper.createBlob(byte[])` instead.

  Create a new `Blob`. The returned object will be initially immutable.

  Parameters:
    `bytes` - a byte array
  Returns:
    the Blob

### createBlob

    public static Blob createBlob(byte[] bytes,
                                  Session session)

  Deprecated. Use `LobHelper.createBlob(byte[])` instead on the `LobHelper` obtained from `Session.getLobHelper()`

  Create a new `Blob`.

  Parameters:
    `bytes` - a byte array
    `session` - The session in which the `Blob` will be used.
  Returns:
    the Blob

### getLobCreator

    public static LobCreator getLobCreator(Session session)

### getLobCreator

    public static LobCreator getLobCreator(SessionImplementor session)

### createBlob

    @Deprecated
    public static Blob createBlob(InputStream stream,
                                             int length)

  Deprecated. Use `LobHelper.createBlob(InputStream, long)` instead.

  Create a new `Blob`. The returned object will be initially immutable.

  Parameters:
    `stream` - a binary stream
    `length` - the number of bytes in the stream
  Returns:
    the Blob

### createBlob

    @Deprecated
    public static Blob createBlob(InputStream stream,
                                             long length)

  Deprecated. Use `LobHelper.createBlob(InputStream, long)` instead.

  Create a new `Blob`. The returned object will be initially immutable.

  Parameters:
    `stream` - a binary stream
    `length` - the number of bytes in the stream
  Returns:
    the Blob

### createBlob

    @Deprecated
    public static Blob createBlob(InputStream stream,
                                             long length,
                                             Session session)

  Deprecated. Use `LobHelper.createBlob(InputStream, long)` instead.

  Create a new `Blob`.

  Parameters:
    `stream` - a binary stream
    `length` - the number of bytes in the stream
    `session` - The session in which the `Blob` will be used.
  Returns:
    the Blob

### createBlob

    @Deprecated
    public static Blob createBlob(InputStream stream)
                           throws IOException

  Deprecated. With no direct replacement. Use `createBlob(InputStream,long)` instead, passing in the length

  Create a new `Blob`. The returned object will be initially immutable.

  NOTE: this method will read the entire contents of the incoming stream in order to properly handle the `Blob.length()` method. If you do not want the stream read, use the `createBlob(InputStream,long)` version instead.

  Parameters:
    `stream` - a binary stream
  Returns:
    the Blob
  Throws:
    `IOException` - Indicates an I/O problem accessing the stream

### createClob

    @Deprecated
    public static Clob createClob(String string)

  Deprecated. Use `LobHelper.createClob(String)` instead

  Create a new `Clob`. The returned object will be initially immutable.

  Parameters:
    `string` - The string data
  Returns:
    The created `Clob`

### createClob

    @Deprecated
    public static Clob createClob(String string,
                                             Session session)

  Deprecated. Use `LobHelper.createClob(String)` instead on the `LobHelper` obtained from `Session.getLobHelper()`

  Create a new `Clob`.

  Parameters:
    `string` - The string data
    `session` - The session in which the `Clob` will be used.
  Returns:
    The created `Clob`

### createClob

    @Deprecated
    public static Clob createClob(Reader reader,
                                             int length)

  Deprecated. Use `LobHelper.createClob(Reader, long)` instead

  Create a new `Clob`. The returned object will be initially immutable.

  Parameters:
    `reader` - a character stream
    `length` - the number of characters in the stream
  Returns:
    The created `Clob`

### createClob

    @Deprecated
    public static Clob createClob(Reader reader,
                                             long length)

  Deprecated. Use `LobHelper.createClob(Reader, long)` instead

  Create a new `Clob`. The returned object will be initially immutable.

  Parameters:
    `reader` - a character stream
    `length` - the number of characters in the stream
  Returns:
    The created `Clob`

### createClob

    @Deprecated
    public static Clob createClob(Reader reader,
                                             long length,
                                             Session session)

  Deprecated. Use `LobHelper.createClob(Reader, long)` instead

  Create a new `Clob`.

  Parameters:
    `reader` - a character stream
    `length` - the number of characters in the stream
    `session` - The session in which the `Clob` will be used.
  Returns:
    The created `Clob`

### close

    public static void close(Iterator iterator)
                      throws HibernateException

  Close an `Iterator` created by `iterate()` immediately, instead of waiting until the session is closed or disconnected.

  Parameters:
    `iterator` - an `Iterator` created by `iterate()`
  Throws:
    `HibernateException`
  See Also:
    `Query.iterate()`, `Query.iterate()`

### isPropertyInitialized

    public static boolean isPropertyInitialized(Object proxy,
                                                String propertyName)

  Check if the property is initialized. If the named property does not exist or is not persistent, this method always returns `true`.

  Parameters:
    `proxy` - The potential proxy
    `propertyName` - the name of a persistent attribute of the object
  Returns:
    true if the named property of the object is not listed as uninitialized; false otherwise

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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