程序包 org.hibernate
类 Hibernate
- java.lang.Object
-
- org.hibernate.Hibernate
-
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static voidclose(Iterator iterator)Close anIteratorinstances obtained fromQuery.iterate()immediately instead of waiting until the session is closed or disconnected.static ClassgetClass(Object proxy)Get the true, underlying class of a proxied persistent class.static LobCreatorgetLobCreator(SessionImplementor session)Obtain a lob creator for the given session.static LobCreatorgetLobCreator(SharedSessionContractImplementor session)Obtain a lob creator for the given session.static LobCreatorgetLobCreator(Session session)Obtain a lob creator for the given session.static voidinitialize(Object proxy)Force initialization of a proxy or persistent collection.static booleanisInitialized(Object proxy)Check if the proxy or persistent collection is initialized.static booleanisPropertyInitialized(Object proxy, String propertyName)Check if the property is initialized.static Objectunproxy(Object proxy)Unproxies aHibernateProxy.static <T> Tunproxy(T proxy, Class<T> entityClass)Unproxies aHibernateProxy.
-
-
-
方法详细资料
-
initialize
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.- 参数:
proxy- a persistable object, proxy, persistent collection or null- 抛出:
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.- 参数:
proxy- a persistable object, proxy, persistent collection or null- 返回:
- 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.- 参数:
proxy- a persistable object or proxy- 返回:
- the true class of the instance
- 抛出:
HibernateException
-
getLobCreator
public static LobCreator getLobCreator(Session session)
Obtain a lob creator for the given session.- 参数:
session- The session for which to obtain a lob creator- 返回:
- The log creator reference
-
getLobCreator
public static LobCreator getLobCreator(SharedSessionContractImplementor session)
Obtain a lob creator for the given session.- 参数:
session- The session for which to obtain a lob creator- 返回:
- The log creator reference
-
getLobCreator
public static LobCreator getLobCreator(SessionImplementor session)
Obtain a lob creator for the given session.- 参数:
session- The session for which to obtain a lob creator- 返回:
- The log creator reference
-
close
public static void close(Iterator iterator) throws HibernateException
Close anIteratorinstances obtained fromQuery.iterate()immediately instead of waiting until the session is closed or disconnected.- 参数:
iterator- an Iterator created by iterate()- 抛出:
HibernateException- Indicates a problem closing the Hibernate iterator.IllegalArgumentException- If the Iterator is not a "Hibernate Iterator".- 另请参阅:
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.- 参数:
proxy- The potential proxypropertyName- the name of a persistent attribute of the object- 返回:
- true if the named property of the object is not listed as uninitialized; false otherwise
-
unproxy
public static Object unproxy(Object proxy)
Unproxies aHibernateProxy. 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.- 参数:
proxy- theHibernateProxyto be unproxied- 返回:
- the proxy's underlying implementation object, or the supplied object otherwise
-
unproxy
public static <T> T unproxy(T proxy, Class<T> entityClass)Unproxies aHibernateProxy. 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.- 参数:
proxy- theHibernateProxyto be unproxiedentityClass- the entity type- 返回:
- the proxy's underlying implementation object, or the supplied object otherwise
-
-