Top Description Inners Fields Constructors Methods
org.hibernate

public final Class Hibernate

extends Object
Class Inheritance
Imports
java.io.IOException, .InputStream, .Reader, .ByteArrayOutputStream, java.sql.Blob, .Clob, java.util.Iterator, .Properties, org.hibernate.collection.PersistentCollection, org.hibernate.engine.HibernateIterator, .SessionFactoryImplementor, .SessionImplementor, org.hibernate.engine.jdbc.NonContextualLobCreator, .LobCreationContext, .LobCreator, .StreamUtils, org.hibernate.intercept.FieldInterceptionHelper, .FieldInterceptor, org.hibernate.proxy.HibernateProxy, .LazyInitializer, org.hibernate.type.CharacterArrayClobType, .MaterializedBlobType, .AnyType, .BigDecimalType, .BigIntegerType, .BinaryType, .BlobType, .BooleanType, .ByteType, .CalendarDateType, .CalendarType, .CharacterType, .ClassType, .ClobType, .CurrencyType, .DateType, .DoubleType, .FloatType, .IntegerType, .LocaleType, .LongType, .ManyToOneType, .ObjectType, .PrimitiveCharacterArrayClobType, .SerializableType, .ShortType, .StringType, .TextType, .TimeType, .TimeZoneType, .TimestampType, .TrueFalseType, .Type, .TypeFactory, .WrappedMaterializedBlobType, .YesNoType, .CharArrayType, .WrapperBinaryType, .CharacterArrayType, .ImageType, .MaterializedClobType, org.hibernate.usertype.CompositeUserType

Author
Gavin King
See Also
java.sql.Clob, java.sql.Blob, org.hibernate.type.Type

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
public static final BigDecimalType
BIG_DECIMAL

Hibernate big_decimal type.

public static final BigIntegerType
BIG_INTEGER

Hibernate big_integer type.

public static final BinaryType
BINARY

Hibernate binary type.

public static final BlobType
BLOB

Hibernate blob type.

public static final BooleanType
BOOLEAN

Hibernate boolean type.

public static final ByteType
BYTE

Hibernate byte type.

public static final CalendarType
CALENDAR

Hibernate calendar type.

public static final CalendarDateType
CALENDAR_DATE

Hibernate calendar_date type.

public static final CharArrayType
CHAR_ARRAY

Hibernate char[] type.

public static final CharacterType
CHARACTER

Hibernate character type.

public static final CharacterArrayType
CHARACTER_ARRAY

Hibernate Character[] type.

public static final PrimitiveCharacterArrayClobType
CHARACTERS_CLOB

Hibernate characters_clob type.

public static final ClassType
CLASS

Hibernate class type.

public static final ClobType
CLOB

Hibernate clob type.

public static final CurrencyType
CURRENCY

Hibernate currency type.

public static final DateType
DATE

Hibernate date type.

public static final DoubleType
DOUBLE

Hibernate double type.

public static final FloatType
FLOAT

Hibernate float type.

public static final ImageType
IMAGE

Hibernate image type.

public static final IntegerType
INTEGER

Hibernate integer type.

public static final LocaleType
LOCALE

Hibernate locale type.

public static final LongType
LONG

Hibernate long type.

public static final MaterializedBlobType
MATERIALIZED_BLOB

Hibernate materialized_blob type.

public static final MaterializedClobType
MATERIALIZED_CLOB

Hibernate materialized_clob type.

public static final ObjectType
OBJECT

Hibernate object type.

public static final SerializableType<T extends Serializable>
SERIALIZABLE

Hibernate serializable type.

public static final ShortType
SHORT

Hibernate short type.

public static final StringType
STRING

Hibernate string type.

public static final TextType
TEXT

Hibernate text type.

public static final TimeType
TIME

Hibernate time type.

public static final TimestampType
TIMESTAMP

Hibernate timestamp type.

public static final TimeZoneType
TIMEZONE

Hibernate timezone type.

public static final TrueFalseType
TRUE_FALSE

Hibernate true_false type.

public static final WrapperBinaryType
WRAPPER_BINARY

Hibernate wrapper-binary type.

public static final CharacterArrayClobType
WRAPPER_CHARACTERS_CLOB

Hibernate wrapper_characters_clob type.

public static final WrappedMaterializedBlobType
WRAPPER_MATERIALIZED_BLOB

Hibernate wrapper_materialized_blob type.

public static final YesNoType
YES_NO

Hibernate yes_no type.

Constructor Summary

AccessConstructor and Description
private
Hibernate()

Cannot be instantiated.

Method Summary

Modifier and TypeMethod and Description
public static Type
any(Type metaType, Type identifierType)

Deprecated Use TypeHelper#any instead.
DO NOT USE!
public static void
close(Iterator<E>
an Iterator created by iterate()
iterator
)

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

public static Blob

Returns:

the Blob
createBlob
(byte[]
a byte array
bytes
)

Deprecated Use LobHelper#createBlob(byte[]) instead.
Create a new Blob.
public static Blob

Returns:

the Blob
createBlob
(byte[]
a byte array
bytes
,
Session
The session in which the Blob will be used.
session
)

Deprecated Use LobHelper#createBlob(byte[]) instead on the LobHelper obtained from Session#getLobHelper()
Create a new Blob.
public static Blob

Returns:

the Blob
createBlob
(InputStream
a binary stream
stream
,
int
the number of bytes in the stream
length
)

Deprecated Use LobHelper#createBlob(InputStream, long) instead.
Create a new Blob.
public static Blob

Returns:

the Blob
createBlob
(InputStream
a binary stream
stream
,
long
the number of bytes in the stream
length
)

Deprecated Use LobHelper#createBlob(InputStream, long) instead.
Create a new Blob.
public static Blob

Returns:

the Blob
createBlob
(InputStream
a binary stream
stream
,
long
the number of bytes in the stream
length
,
Session
The session in which the Blob will be used.
session
)

Deprecated Use LobHelper#createBlob(InputStream, long) instead.
Create a new Blob.
public static Blob

Returns:

the Blob
createBlob
(InputStream
a binary stream
stream
)

Deprecated With no direct replacement. Use createBlob(InputStream, long) instead, passing in the length
Create a new Blob.
public static Clob

Returns:

The created Clob
createClob
(String
The string data
string
)

Deprecated Use LobHelper#createClob(String) instead
Create a new Clob.
public static Clob

Returns:

The created Clob
createClob
(String
The string data
string
,
Session
The session in which the Clob will be used.
session
)

Deprecated Use LobHelper#createClob(String) instead on the LobHelper obtained from Session#getLobHelper()
Create a new Clob.
public static Clob

Returns:

The created Clob
createClob
(Reader
a character stream
reader
,
int
the number of characters in the stream
length
)

Deprecated Use LobHelper#createClob(Reader, long) instead
Create a new Clob.
public static Clob

Returns:

The created Clob
createClob
(Reader
a character stream
reader
,
long
the number of characters in the stream
length
)

Deprecated Use LobHelper#createClob(Reader, long) instead
Create a new Clob.
public static Clob

Returns:

The created Clob
createClob
(Reader
a character stream
reader
,
long
the number of characters in the stream
length
,
Session
The session in which the Clob will be used.
session
)

Deprecated Use LobHelper#createClob(Reader, long) instead
Create a new Clob.
public static Type
custom(Class<T> userTypeClass)

Deprecated Use TypeHelper#custom instead; see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182
DO NOT USE!
public static Type
custom(Class<T> userTypeClass, String[] parameterNames, String[] parameterValues)

Deprecated Use TypeHelper#custom instead; see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182
DO NOT USE!
public static Type
custom(Class<T> userTypeClass, Properties parameters)

Deprecated Use TypeHelper#custom instead; see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182
DO NOT USE!
public static Type
entity(Class<T> persistentClass)

Deprecated Use TypeHelper#entity instead; see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182
DO NOT USE!
public static Type
entity(String entityName)

Deprecated Use TypeHelper#entity instead; see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182
DO NOT USE!
public static Class<T>

Returns:

the true class of the instance
getClass
(Object
a persistable object or proxy
proxy
)

Get the true, underlying class of a proxied persistent class.

public static LobCreator
public static LobCreator
public static void
initialize(Object
a persistable object, proxy, persistent collection or null
proxy
)

Force initialization of a proxy or persistent collection.

public static boolean

Returns:

true if the argument is already initialized, or is not a proxy or collection
isInitialized
(Object
a persistable object, proxy, persistent collection or null
proxy
)

Check if the proxy or persistent collection is initialized.

public static boolean

Returns:

true if the named property of the object is not listed as uninitialized; false otherwise
isPropertyInitialized
(Object
The potential proxy
proxy
,
String
the name of a persistent attribute of the object
propertyName
)

Check if the property is initialized.

public static Type
serializable(Class<T>
The java.io.Serializable implementor class.
serializableClass
)

Deprecated Use SerializableType#SerializableType instead.
A Hibernate serializable type.
private static Properties
toProperties(String[] parameterNames, String[] parameterValues)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BIG_DECIMALback to summary
public static final BigDecimalType BIG_DECIMAL

Hibernate big_decimal type.

BIG_INTEGERback to summary
public static final BigIntegerType BIG_INTEGER

Hibernate big_integer type.

BINARYback to summary
public static final BinaryType BINARY

Hibernate binary type.

BLOBback to summary
public static final BlobType BLOB

Hibernate blob type.

BOOLEANback to summary
public static final BooleanType BOOLEAN

Hibernate boolean type.

BYTEback to summary
public static final ByteType BYTE

Hibernate byte type.

CALENDARback to summary
public static final CalendarType CALENDAR

Hibernate calendar type.

CALENDAR_DATEback to summary
public static final CalendarDateType CALENDAR_DATE

Hibernate calendar_date type.

CHAR_ARRAYback to summary
public static final CharArrayType CHAR_ARRAY

Hibernate char[] type.

CHARACTERback to summary
public static final CharacterType CHARACTER

Hibernate character type.

CHARACTER_ARRAYback to summary
public static final CharacterArrayType CHARACTER_ARRAY

Hibernate Character[] type.

CHARACTERS_CLOBback to summary
public static final PrimitiveCharacterArrayClobType CHARACTERS_CLOB

Hibernate characters_clob type.

CLASSback to summary
public static final ClassType CLASS

Hibernate class type.

CLOBback to summary
public static final ClobType CLOB

Hibernate clob type.

CURRENCYback to summary
public static final CurrencyType CURRENCY

Hibernate currency type.

DATEback to summary
public static final DateType DATE

Hibernate date type.

DOUBLEback to summary
public static final DoubleType DOUBLE

Hibernate double type.

FLOATback to summary
public static final FloatType FLOAT

Hibernate float type.

IMAGEback to summary
public static final ImageType IMAGE

Hibernate image type.

INTEGERback to summary
public static final IntegerType INTEGER

Hibernate integer type.

LOCALEback to summary
public static final LocaleType LOCALE

Hibernate locale type.

LONGback to summary
public static final LongType LONG

Hibernate long type.

MATERIALIZED_BLOBback to summary
public static final MaterializedBlobType MATERIALIZED_BLOB

Hibernate materialized_blob type.

MATERIALIZED_CLOBback to summary
public static final MaterializedClobType MATERIALIZED_CLOB

Hibernate materialized_clob type.

OBJECTback to summary
public static final ObjectType OBJECT

Deprecated

Use ObjectType#INSTANCE instead.

Hibernate object type.

SERIALIZABLEback to summary
public static final SerializableType<T extends Serializable> SERIALIZABLE

Hibernate serializable type.

SHORTback to summary
public static final ShortType SHORT

Hibernate short type.

STRINGback to summary
public static final StringType STRING

Hibernate string type.

TEXTback to summary
public static final TextType TEXT

Hibernate text type.

TIMEback to summary
public static final TimeType TIME

Hibernate time type.

TIMESTAMPback to summary
public static final TimestampType TIMESTAMP

Hibernate timestamp type.

TIMEZONEback to summary
public static final TimeZoneType TIMEZONE

Hibernate timezone type.

TRUE_FALSEback to summary
public static final TrueFalseType TRUE_FALSE

Hibernate true_false type.

WRAPPER_BINARYback to summary
public static final WrapperBinaryType WRAPPER_BINARY

Hibernate wrapper-binary type.

WRAPPER_CHARACTERS_CLOBback to summary
public static final CharacterArrayClobType WRAPPER_CHARACTERS_CLOB

Hibernate wrapper_characters_clob type.

WRAPPER_MATERIALIZED_BLOBback to summary
public static final WrappedMaterializedBlobType WRAPPER_MATERIALIZED_BLOB

Hibernate wrapper_materialized_blob type.

YES_NOback to summary
public static final YesNoType YES_NO

Hibernate yes_no type.

Constructor Detail

Hibernateback to summary
private Hibernate()

Cannot be instantiated.

Method Detail

anyback to summary
public static Type any(Type metaType, Type identifierType)

Deprecated

Use TypeHelper#any instead.

DO NOT USE!

Annotations
@SuppressWarnings:JavaDoc, UnusedDeclaration
closeback to summary
public static void close(Iterator<E> iterator) throws HibernateException

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

Parameters
iterator:Iterator<E>

an Iterator created by iterate()

See Also
org.hibernate.Query#iterate, Query#iterate()
createBlobback to summary
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:byte[]

a byte array

Returns:Blob

the Blob

createBlobback to summary
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:byte[]

a byte array

session:Session

The session in which the Blob will be used.

Returns:Blob

the Blob

createBlobback to summary
public static Blob createBlob(InputStream stream, int length)

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

Parameters
stream:InputStream

a binary stream

length:int

the number of bytes in the stream

Returns:Blob

the Blob

Annotations
@Deprecated
createBlobback to summary
public static Blob createBlob(InputStream stream, long length)

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

Parameters
stream:InputStream

a binary stream

length:long

the number of bytes in the stream

Returns:Blob

the Blob

Annotations
@Deprecated
createBlobback to summary
public static Blob createBlob(InputStream stream, long length, Session session)

Create a new Blob.

Parameters
stream:InputStream

a binary stream

length:long

the number of bytes in the stream

session:Session

The session in which the Blob will be used.

Returns:Blob

the Blob

Annotations
@Deprecated
createBlobback to summary
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:InputStream

a binary stream

Returns:Blob

the Blob

Annotations
@Deprecated
Exceptions
IOException:
Indicates an I/O problem accessing the stream
createClobback to summary
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:String

The string data

Returns:Clob

The created Clob

Annotations
@Deprecated
createClobback to summary
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:String

The string data

session:Session

The session in which the Clob will be used.

Returns:Clob

The created Clob

Annotations
@Deprecated
createClobback to summary
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:Reader

a character stream

length:int

the number of characters in the stream

Returns:Clob

The created Clob

Annotations
@Deprecated
createClobback to summary
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:Reader

a character stream

length:long

the number of characters in the stream

Returns:Clob

The created Clob

Annotations
@Deprecated
createClobback to summary
public static Clob createClob(Reader reader, long length, Session session)

Deprecated

Use LobHelper#createClob(Reader, long) instead

Create a new Clob.

Parameters
reader:Reader

a character stream

length:long

the number of characters in the stream

session:Session

The session in which the Clob will be used.

Returns:Clob

The created Clob

Annotations
@Deprecated
customback to summary
public static Type custom(Class<T> userTypeClass)

Deprecated

Use TypeHelper#custom instead; see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182

DO NOT USE!

Annotations
@SuppressWarnings:JavaDoc, UnusedDeclaration
customback to summary
public static Type custom(Class<T> userTypeClass, String[] parameterNames, String[] parameterValues)

Deprecated

Use TypeHelper#custom instead; see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182

DO NOT USE!

Annotations
@SuppressWarnings:JavaDoc, UnusedDeclaration
customback to summary
public static Type custom(Class<T> userTypeClass, Properties parameters)

Deprecated

Use TypeHelper#custom instead; see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182

DO NOT USE!

Annotations
@SuppressWarnings:JavaDoc, UnusedDeclaration, unchecked
entityback to summary
public static Type entity(Class<T> persistentClass)

Deprecated

Use TypeHelper#entity instead; see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182

DO NOT USE!

Annotations
@SuppressWarnings:JavaDoc, UnusedDeclaration, deprecation
entityback to summary
public static Type entity(String entityName)

Deprecated

Use TypeHelper#entity instead; see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182

DO NOT USE!

Annotations
@SuppressWarnings:JavaDoc, UnusedDeclaration
getClassback to summary
public static Class<T> getClass(Object proxy)

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

Parameters
proxy:Object

a persistable object or proxy

Returns:Class<T>

the true class of the instance

getLobCreatorback to summary
public static LobCreator getLobCreator(Session session)
getLobCreatorback to summary
public static LobCreator getLobCreator(SessionImplementor session)
initializeback to summary
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:Object

a persistable object, proxy, persistent collection or null

Exceptions
HibernateException:
if we can't initialize the proxy at this time, eg. the Session was closed
isInitializedback to summary
public static boolean isInitialized(Object proxy)

Check if the proxy or persistent collection is initialized.

Parameters
proxy:Object

a persistable object, proxy, persistent collection or null

Returns:boolean

true if the argument is already initialized, or is not a proxy or collection

isPropertyInitializedback to summary
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:Object

The potential proxy

propertyName:String

the name of a persistent attribute of the object

Returns:boolean

true if the named property of the object is not listed as uninitialized; false otherwise

serializableback to summary
public static Type serializable(Class<T> serializableClass)

Deprecated

Use SerializableType#SerializableType instead.

A Hibernate serializable type.

Parameters
serializableClass:Class<T>

The java.io.Serializable implementor class.

Annotations
@SuppressWarnings:unchecked
toPropertiesback to summary
private static Properties toProperties(String[] parameterNames, String[] parameterValues)
org.hibernate back to summary

private Class Hibernate.NoScope

extends Object
implements TypeScope
Class Inheritance
All Implemented Interfaces
org.hibernate.type.TypeFactory.TypeScope, java.io.Serializable

Field Summary

Modifier and TypeField and Description
public static final Hibernate.NoScope

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public SessionFactoryImplementor
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
public static final Hibernate.NoScope INSTANCE

Constructor Detail

NoScopeback to summary
private NoScope()

Method Detail

resolveFactoryback to summary
public SessionFactoryImplementor resolveFactory()

Implements org.hibernate.type.TypeFactory.TypeScope.resolveFactory.