public final class

Hibernate

extends Object
java.lang.Object
   ↳ org.hibernate.Hibernate

Class Overview

  • 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 Blobs and Clobs.
  • Defines static methods for manipulation of proxies.

See Also
  • java.sql.Clob
  • java.sql.Blob
  • Type

Summary

Fields
public static final BigDecimalType BIG_DECIMAL This field is deprecated. Use BIG_DECIMAL instead.
public static final BigIntegerType BIG_INTEGER This field is deprecated. Use BIG_INTEGER instead.
public static final BinaryType BINARY This field is deprecated. Use BINARY instead.
public static final BlobType BLOB This field is deprecated. Use BLOB instead.
public static final BooleanType BOOLEAN This field is deprecated. Use BOOLEAN instead.
public static final ByteType BYTE This field is deprecated. Use BYTE instead.
public static final CalendarType CALENDAR This field is deprecated. Use CALENDAR instead.
public static final CalendarDateType CALENDAR_DATE This field is deprecated. Use CALENDAR_DATE instead.
public static final CharacterType CHARACTER This field is deprecated. Use CHARACTER instead.
public static final PrimitiveCharacterArrayClobType CHARACTERS_CLOB This field is deprecated. Use CHARACTERS_CLOB instead.
public static final CharacterArrayType CHARACTER_ARRAY This field is deprecated. Use CHARACTER_ARRAY instead.
public static final CharArrayType CHAR_ARRAY This field is deprecated. Use CHAR_ARRAY instead.
public static final ClassType CLASS This field is deprecated. Use CLASS instead.
public static final ClobType CLOB This field is deprecated. Use CLOB instead.
public static final CurrencyType CURRENCY This field is deprecated. Use CURRENCY instead.
public static final DateType DATE This field is deprecated. Use DATE instead.
public static final DoubleType DOUBLE This field is deprecated. Use DOUBLE instead.
public static final FloatType FLOAT This field is deprecated. Use FLOAT instead.
public static final ImageType IMAGE This field is deprecated. Use IMAGE instead.
public static final IntegerType INTEGER This field is deprecated. Use INTEGER instead.
public static final LocaleType LOCALE This field is deprecated. Use LOCALE instead.
public static final LongType LONG This field is deprecated. Use LONG instead.
public static final MaterializedBlobType MATERIALIZED_BLOB This field is deprecated. Use MATERIALIZED_BLOB instead.
public static final MaterializedClobType MATERIALIZED_CLOB This field is deprecated. Use MATERIALIZED_CLOB instead.
public static final ObjectType OBJECT This field is deprecated. Use INSTANCE instead.
public static final SerializableType SERIALIZABLE This field is deprecated. Use SERIALIZABLE instead.
public static final ShortType SHORT This field is deprecated. Use SHORT instead.
public static final StringType STRING This field is deprecated. Use STRING instead.
public static final TextType TEXT This field is deprecated. Use TEXT instead.
public static final TimeType TIME This field is deprecated. Use TIME instead.
public static final TimestampType TIMESTAMP This field is deprecated. Use TIMESTAMP instead.
public static final TimeZoneType TIMEZONE This field is deprecated. Use TIMEZONE instead.
public static final TrueFalseType TRUE_FALSE This field is deprecated. Use TRUE_FALSE instead.
public static final WrapperBinaryType WRAPPER_BINARY This field is deprecated. Use WRAPPER_BINARY instead.
public static final CharacterArrayClobType WRAPPER_CHARACTERS_CLOB This field is deprecated. Use WRAPPER_CHARACTERS_CLOB instead.
public static final WrappedMaterializedBlobType WRAPPER_MATERIALIZED_BLOB This field is deprecated. Use WRAPPER_MATERIALIZED_BLOB instead.
public static final YesNoType YES_NO This field is deprecated. Use YES_NO instead.
Public Methods
static Type any(Type metaType, Type identifierType)
This method is deprecated. Use any(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, Session session)
This method is deprecated. Use createBlob(byte[]) instead on the LobHelper obtained from getLobHelper()
static Blob createBlob(InputStream stream, long length, Session session)
This method is deprecated. Use createBlob(InputStream, long) instead.
static Blob createBlob(InputStream stream)
This method is deprecated. With no direct replacement. Use createBlob(InputStream, long) instead, passing in the length
static Blob createBlob(InputStream stream, int length)
This method is deprecated. Use createBlob(InputStream, long) instead.
static Blob createBlob(InputStream stream, long length)
This method is deprecated. Use createBlob(InputStream, long) instead.
static Blob createBlob(byte[] bytes)
This method is deprecated. Use createBlob(byte[]) instead.
static Clob createClob(Reader reader, long length, Session session)
This method is deprecated. Use createClob(Reader, long) instead
static Clob createClob(String string)
This method is deprecated. Use createClob(String) instead
static Clob createClob(Reader reader, int length)
This method is deprecated. Use createClob(Reader, long) instead
static Clob createClob(String string, Session session)
This method is deprecated. Use createClob(String) instead on the LobHelper obtained from getLobHelper()
static Clob createClob(Reader reader, long length)
This method is deprecated. Use createClob(Reader, long) instead
static Type custom(Class userTypeClass, String[] parameterNames, String[] parameterValues)
This method is deprecated. Use custom(Class) instead; see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182
static Type custom(Class userTypeClass)
This method is deprecated. Use custom(Class) instead; see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182
static Type custom(Class userTypeClass, Properties parameters)
This method is deprecated. Use custom(Class) instead; see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182
static Type entity(String entityName)
This method is deprecated. Use entity(Class) instead; see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182
static Type entity(Class persistentClass)
This method is deprecated. Use entity(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)
This method is deprecated. Use SerializableType(Class) instead.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

public static final BigDecimalType BIG_DECIMAL

This field is deprecated.
Use BIG_DECIMAL instead.

Hibernate big_decimal type.

public static final BigIntegerType BIG_INTEGER

This field is deprecated.
Use BIG_INTEGER instead.

Hibernate big_integer type.

public static final BinaryType BINARY

This field is deprecated.
Use BINARY instead.

Hibernate binary type.

public static final BlobType BLOB

This field is deprecated.
Use BLOB instead.

Hibernate blob type.

public static final BooleanType BOOLEAN

This field is deprecated.
Use BOOLEAN instead.

Hibernate boolean type.

public static final ByteType BYTE

This field is deprecated.
Use BYTE instead.

Hibernate byte type.

public static final CalendarType CALENDAR

This field is deprecated.
Use CALENDAR instead.

Hibernate calendar type.

public static final CalendarDateType CALENDAR_DATE

This field is deprecated.
Use CALENDAR_DATE instead.

Hibernate calendar_date type.

public static final CharacterType CHARACTER

This field is deprecated.
Use CHARACTER instead.

Hibernate character type.

public static final PrimitiveCharacterArrayClobType CHARACTERS_CLOB

This field is deprecated.
Use CHARACTERS_CLOB instead.

Hibernate characters_clob type.

public static final CharacterArrayType CHARACTER_ARRAY

This field is deprecated.
Use CHARACTER_ARRAY instead.

Hibernate Character[] type.

public static final CharArrayType CHAR_ARRAY

This field is deprecated.
Use CHAR_ARRAY instead.

Hibernate char[] type.

public static final ClassType CLASS

This field is deprecated.
Use CLASS instead.

Hibernate class type.

public static final ClobType CLOB

This field is deprecated.
Use CLOB instead.

Hibernate clob type.

public static final CurrencyType CURRENCY

This field is deprecated.
Use CURRENCY instead.

Hibernate currency type.

public static final DateType DATE

This field is deprecated.
Use DATE instead.

Hibernate date type.

public static final DoubleType DOUBLE

This field is deprecated.
Use DOUBLE instead.

Hibernate double type.

public static final FloatType FLOAT

This field is deprecated.
Use FLOAT instead.

Hibernate float type.

public static final ImageType IMAGE

This field is deprecated.
Use IMAGE instead.

Hibernate image type.

public static final IntegerType INTEGER

This field is deprecated.
Use INTEGER instead.

Hibernate integer type.

public static final LocaleType LOCALE

This field is deprecated.
Use LOCALE instead.

Hibernate locale type.

public static final LongType LONG

This field is deprecated.
Use LONG instead.

Hibernate long type.

public static final MaterializedBlobType MATERIALIZED_BLOB

This field is deprecated.
Use MATERIALIZED_BLOB instead.

Hibernate materialized_blob type.

public static final MaterializedClobType MATERIALIZED_CLOB

This field is deprecated.
Use MATERIALIZED_CLOB instead.

Hibernate materialized_clob type.

public static final ObjectType OBJECT

This field is deprecated.
Use INSTANCE instead.

Hibernate object type.

public static final SerializableType SERIALIZABLE

This field is deprecated.
Use SERIALIZABLE instead.

Hibernate serializable type.

public static final ShortType SHORT

This field is deprecated.
Use SHORT instead.

Hibernate short type.

public static final StringType STRING

This field is deprecated.
Use STRING instead.

Hibernate string type.

public static final TextType TEXT

This field is deprecated.
Use TEXT instead.

Hibernate text type.

public static final TimeType TIME

This field is deprecated.
Use TIME instead.

Hibernate time type.

public static final TimestampType TIMESTAMP

This field is deprecated.
Use TIMESTAMP instead.

Hibernate timestamp type.

public static final TimeZoneType TIMEZONE

This field is deprecated.
Use TIMEZONE instead.

Hibernate timezone type.

public static final TrueFalseType TRUE_FALSE

This field is deprecated.
Use TRUE_FALSE instead.

Hibernate true_false type.

public static final WrapperBinaryType WRAPPER_BINARY

This field is deprecated.
Use WRAPPER_BINARY instead.

Hibernate wrapper-binary type.

public static final CharacterArrayClobType WRAPPER_CHARACTERS_CLOB

This field is deprecated.
Use WRAPPER_CHARACTERS_CLOB instead.

Hibernate wrapper_characters_clob type.

public static final WrappedMaterializedBlobType WRAPPER_MATERIALIZED_BLOB

This field is deprecated.
Use WRAPPER_MATERIALIZED_BLOB instead.

Hibernate wrapper_materialized_blob type.

public static final YesNoType YES_NO

This field is deprecated.
Use YES_NO instead.

Hibernate yes_no type.

Public Methods

public static Type any (Type metaType, Type identifierType)

This method is deprecated.
Use any(Type, Type) instead.

DO NOT USE!

public static void close (Iterator iterator)

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
HibernateException

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

This method is deprecated.
Use createBlob(byte[]) instead on the LobHelper obtained from getLobHelper()

Create a new Blob.

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

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

This method is deprecated.
Use 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

public static Blob createBlob (InputStream stream)

This method is 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 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

public static Blob createBlob (InputStream stream, int length)

This method is deprecated.
Use 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

public static Blob createBlob (InputStream stream, long length)

This method is deprecated.
Use 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

public static Blob createBlob (byte[] bytes)

This method is deprecated.
Use createBlob(byte[]) instead.

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

Parameters
bytes a byte array
Returns
  • the Blob

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

This method is deprecated.
Use 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

public static Clob createClob (String string)

This method is deprecated.
Use createClob(String) instead

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

Parameters
string The string data
Returns

public static Clob createClob (Reader reader, int length)

This method is deprecated.
Use 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

public static Clob createClob (String string, Session session)

This method is deprecated.
Use createClob(String) instead on the LobHelper obtained from getLobHelper()

Create a new Clob.

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

public static Clob createClob (Reader reader, long length)

This method is deprecated.
Use 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

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

This method is deprecated.
Use custom(Class) instead; see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182

DO NOT USE!

public static Type custom (Class userTypeClass)

This method is deprecated.
Use custom(Class) instead; see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182

DO NOT USE!

public static Type custom (Class userTypeClass, Properties parameters)

This method is deprecated.
Use custom(Class) instead; see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182

DO NOT USE!

public static Type entity (String entityName)

This method is deprecated.
Use entity(Class) instead; see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182

DO NOT USE!

public static Type entity (Class persistentClass)

This method is deprecated.
Use entity(Class) instead; see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182

DO NOT USE!

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

public static LobCreator getLobCreator (Session session)

public static LobCreator getLobCreator (SessionImplementor session)

public static void initialize (Object proxy)

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

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

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

public static Type serializable (Class serializableClass)

This method is deprecated.
Use SerializableType(Class) instead.

A Hibernate serializable type.@return

Parameters
serializableClass The Serializable implementor class.