org.hibernate
Class Hibernate

java.lang.Object
  extended by org.hibernate.Hibernate

public final class Hibernate
extends Object

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

Field Summary
static NullableType BIG_DECIMAL
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
static NullableType BIG_INTEGER
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
static NullableType BINARY
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
static Type BLOB
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
static NullableType BOOLEAN
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
static NullableType BYTE
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
static NullableType CALENDAR
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
static NullableType CALENDAR_DATE
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
static NullableType CHAR_ARRAY
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
static NullableType CHARACTER
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
static NullableType CHARACTER_ARRAY
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
static NullableType CLASS
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
static Type CLOB
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
static NullableType CURRENCY
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
static NullableType DATE
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
static NullableType DOUBLE
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
static NullableType FLOAT
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
static NullableType IMAGE
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
static NullableType INTEGER
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
static NullableType LOCALE
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
static NullableType LONG
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
static NullableType MATERIALIZED_BLOB
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
static NullableType MATERIALIZED_CLOB
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
static Type OBJECT
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
static NullableType SERIALIZABLE
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
static NullableType SHORT
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
static NullableType STRING
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
static NullableType TEXT
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
static NullableType TIME
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
static NullableType TIMESTAMP
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
static NullableType TIMEZONE
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
static NullableType TRUE_FALSE
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
static NullableType WRAPPER_BINARY
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
static NullableType YES_NO
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
 
Method Summary
static Type any(Type metaType, Type identifierType)
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182
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 createBlob(byte[], Session) instead
static Blob createBlob(byte[] bytes, Session session)
          Create a new Blob.
static Blob createBlob(InputStream stream)
          Deprecated. Use createBlob(InputStream, long, Session) instead
static Blob createBlob(InputStream stream, int length)
          Deprecated. Use createBlob(InputStream, long, Session) instead
static Blob createBlob(InputStream stream, long length)
          Deprecated. Use createBlob(InputStream, long, Session) instead
static Blob createBlob(InputStream stream, long length, Session session)
          Create a new Blob.
static Clob createClob(Reader reader, int length)
          Deprecated. Use createClob(Reader,long,Session) instead
static Clob createClob(Reader reader, long length)
          Deprecated. Use createClob(Reader,long,Session) instead
static Clob createClob(Reader reader, long length, Session session)
          Create a new Clob.
static Clob createClob(String string)
          Deprecated. Use createClob(String, Session) instead
static Clob createClob(String string, Session session)
          Create a new Clob.
static Type custom(Class userTypeClass)
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182
static Type custom(Class userTypeClass, Properties parameters)
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182
static Type custom(Class userTypeClass, String[] parameterNames, String[] parameterValues)
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182
static Type entity(Class persistentClass)
          Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182
static Type entity(String entityName)
          Deprecated. 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. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LONG

public static final NullableType LONG
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
Hibernate long type.


SHORT

public static final NullableType SHORT
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
Hibernate short type.


INTEGER

public static final NullableType INTEGER
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
Hibernate integer type.


BYTE

public static final NullableType BYTE
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
Hibernate byte type.


FLOAT

public static final NullableType FLOAT
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
Hibernate float type.


DOUBLE

public static final NullableType DOUBLE
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
Hibernate double type.


CHARACTER

public static final NullableType CHARACTER
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
Hibernate character type.


STRING

public static final NullableType STRING
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
Hibernate string type.


TIME

public static final NullableType TIME
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
Hibernate time type.


DATE

public static final NullableType DATE
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
Hibernate date type.


TIMESTAMP

public static final NullableType TIMESTAMP
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
Hibernate timestamp type.


BOOLEAN

public static final NullableType BOOLEAN
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
Hibernate boolean type.


TRUE_FALSE

public static final NullableType TRUE_FALSE
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
Hibernate true_false type.


YES_NO

public static final NullableType YES_NO
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
Hibernate yes_no type.


BIG_DECIMAL

public static final NullableType BIG_DECIMAL
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
Hibernate big_decimal type.


BIG_INTEGER

public static final NullableType BIG_INTEGER
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
Hibernate big_integer type.


BINARY

public static final NullableType BINARY
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
Hibernate binary type.


WRAPPER_BINARY

public static final NullableType WRAPPER_BINARY
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
Hibernate wrapper-binary type.


CHAR_ARRAY

public static final NullableType CHAR_ARRAY
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
Hibernate char[] type.


CHARACTER_ARRAY

public static final NullableType CHARACTER_ARRAY
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
Hibernate Character[] type.


IMAGE

public static final NullableType IMAGE
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
Hibernate image type.


TEXT

public static final NullableType TEXT
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
Hibernate text type.


MATERIALIZED_BLOB

public static final NullableType MATERIALIZED_BLOB
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
Hibernate materialized_blob type.


MATERIALIZED_CLOB

public static final NullableType MATERIALIZED_CLOB
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
Hibernate materialized_clob type.


BLOB

public static final Type BLOB
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
Hibernate blob type.


CLOB

public static final Type CLOB
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
Hibernate clob type.


CALENDAR

public static final NullableType CALENDAR
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
Hibernate calendar type.


CALENDAR_DATE

public static final NullableType CALENDAR_DATE
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
Hibernate calendar_date type.


LOCALE

public static final NullableType LOCALE
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
Hibernate locale type.


CURRENCY

public static final NullableType CURRENCY
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
Hibernate currency type.


TIMEZONE

public static final NullableType TIMEZONE
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
Hibernate timezone type.


CLASS

public static final NullableType CLASS
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
Hibernate class type.


SERIALIZABLE

public static final NullableType SERIALIZABLE
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
Hibernate serializable type.


OBJECT

public static final Type OBJECT
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138
Hibernate object type.

Method Detail

serializable

public static Type serializable(Class serializableClass)
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138

A Hibernate serializable type.


any

public static Type any(Type metaType,
                       Type identifierType)
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182

A Hibernate any type.

Parameters:
metaType - a type mapping java.lang.Class to a single column
identifierType - the entity identifier type
Returns:
the Type

entity

public static Type entity(Class persistentClass)
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182

A Hibernate persistent object (entity) type.

Parameters:
persistentClass - a mapped entity class

entity

public static Type entity(String entityName)
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182

A Hibernate persistent object (entity) type.

Parameters:
entityName - a mapped entity class

custom

public static Type custom(Class userTypeClass)
                   throws HibernateException
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182

A Hibernate custom type.

Parameters:
userTypeClass - a class that implements UserType
Throws:
HibernateException

custom

public static Type custom(Class userTypeClass,
                          String[] parameterNames,
                          String[] parameterValues)
                   throws HibernateException
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182

A Hibernate parameterizable custom type.

Parameters:
userTypeClass - a class that implements UserType and ParameterizableType
parameterNames - the names of the parameters passed to the type
parameterValues - the values of the parameters passed to the type. They must match up with the order and length of the parameterNames array.
Throws:
HibernateException

custom

public static Type custom(Class userTypeClass,
                          Properties parameters)
                   throws HibernateException
Deprecated. see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182

A Hibernate parameterizable custom type.

Parameters:
userTypeClass - a class that implements UserType and ParameterizableType
parameters - the parameters as a collection of name/value pairs
Throws:
HibernateException

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 createBlob(byte[], Session) 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)
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

public static Blob createBlob(InputStream stream,
                              int length)
Deprecated. Use createBlob(InputStream, long, Session) 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

public static Blob createBlob(InputStream stream,
                              long length)
Deprecated. Use createBlob(InputStream, long, Session) 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

public static Blob createBlob(InputStream stream,
                              long length,
                              Session session)
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

public static Blob createBlob(InputStream stream)
                       throws IOException
Deprecated. Use createBlob(InputStream, long, Session) instead

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

public static Clob createClob(String string)
Deprecated. Use createClob(String, Session) instead

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

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

createClob

public static Clob createClob(String string,
                              Session session)
Create a new Clob.

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

createClob

public static Clob createClob(Reader reader,
                              int length)
Deprecated. Use createClob(Reader,long,Session) 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

public static Clob createClob(Reader reader,
                              long length)
Deprecated. Use createClob(Reader,long,Session) 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

public static Clob createClob(Reader reader,
                              long length,
                              Session session)
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


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