Top Description Constructors Methods
org.hibernate

public final Class Hibernate

extends Object
Class Inheritance
Imports
java.util.Iterator, org.hibernate.bytecode.enhance.spi.interceptor.BytecodeLazyAttributeInterceptor, .EnhancementAsProxyLazinessInterceptor, org.hibernate.engine.HibernateIterator, org.hibernate.engine.jdbc.LobCreator, org.hibernate.engine.jdbc.spi.JdbcServices, org.hibernate.engine.spi.PersistentAttributeInterceptor, .SessionImplementor, .SharedSessionContractImplementor, org.hibernate.proxy.HibernateProxy, .LazyInitializer, org.hibernate.collection.spi.LazyInitializable

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

Constructor Summary

AccessConstructor and Description
private
Hibernate()

Cannot be instantiated.

Method Summary

Modifier and TypeMethod and Description
public static void
close(Iterator<E>
an Iterator created by iterate()
iterator
)

Close an Iterator instances obtained from org.hibernate.Query#iterate() immediately instead of waiting until the session is closed or disconnected.

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

Returns:

The log creator reference
getLobCreator
(Session
The session for which to obtain a lob creator
session
)

Deprecated as a consequence of Session being deprecated.
Obtain a lob creator for the given session.
public static LobCreator

Returns:

The log creator reference
getLobCreator
(SharedSessionContractImplementor
The session for which to obtain a lob creator
session
)

Obtain a lob creator for the given session.

public static LobCreator

Returns:

The log creator reference
getLobCreator
(SessionImplementor
The session for which to obtain a lob creator
session
)

Deprecated as a consequence of SessionImplementor being deprecated.
Obtain a lob creator for the given session.
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 Object

Returns:

the proxy's underlying implementation object, or the supplied object otherwise
unproxy
(Object
the HibernateProxy to be unproxied
proxy
)

Unproxies a HibernateProxy.

public static <T> T

Returns:

the proxy's underlying implementation object, or the supplied object otherwise
unproxy
(T
the HibernateProxy to be unproxied
proxy
,
Class<T>
the entity type
entityClass
)

Unproxies a HibernateProxy.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Hibernateback to summary
private Hibernate()

Cannot be instantiated.

Method Detail

closeback to summary
public static void close(Iterator<E> iterator) throws HibernateException

Close an Iterator instances obtained from org.hibernate.Query#iterate() immediately instead of waiting until the session is closed or disconnected.

Parameters
iterator:Iterator<E>

an Iterator created by iterate()

Exceptions
HibernateException:
Indicates a problem closing the Hibernate iterator.
IllegalArgumentException:
If the Iterator is not a "Hibernate Iterator".
See Also
Query#iterate()
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)

Deprecated

as a consequence of Session being deprecated. See corresponding docs for further information.

Obtain a lob creator for the given session.

Parameters
session:Session

The session for which to obtain a lob creator

Returns:LobCreator

The log creator reference

getLobCreatorback to summary
public static LobCreator getLobCreator(SharedSessionContractImplementor session)

Obtain a lob creator for the given session.

Parameters
session:SharedSessionContractImplementor

The session for which to obtain a lob creator

Returns:LobCreator

The log creator reference

getLobCreatorback to summary
public static LobCreator getLobCreator(SessionImplementor session)

Deprecated

as a consequence of SessionImplementor being deprecated. See corresponding docs for further information.

Obtain a lob creator for the given session.

Parameters
session:SessionImplementor

The session for which to obtain a lob creator

Returns:LobCreator

The log creator reference

initializeback to summary
public static void initialize(Object proxy) throws HibernateException

Force initialization of a proxy or persistent collection.

Note

This only ensures initialization 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

Annotations
@SuppressWarnings:SimplifiableIfStatement
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

unproxyback to summary
public static Object unproxy(Object proxy)

Unproxies a HibernateProxy. If the proxy is uninitialized, it automatically triggers an initialization. In case the supplied object is null or not a proxy, the object will be returned as-is.

Parameters
proxy:Object

the HibernateProxy to be unproxied

Returns:Object

the proxy's underlying implementation object, or the supplied object otherwise

unproxyback to summary
public static <T> T unproxy(T proxy, Class<T> entityClass)

Unproxies a HibernateProxy. If the proxy is uninitialized, it automatically triggers an initialization. In case the supplied object is null or not a proxy, the object will be returned as-is.

Parameters
proxy:T

the HibernateProxy to be unproxied

entityClass:Class<T>

the entity type

Returns:T

the proxy's underlying implementation object, or the supplied object otherwise