public class HibernateProxyHelper
extends java.lang.Object
Constructor and Description |
---|
HibernateProxyHelper() |
Modifier and Type | Method and Description |
---|---|
static <T> T |
deproxy(java.lang.Object object,
java.lang.Class<T> clazz)
Deproxy and cast the given object to the given class.
|
static <T> T |
deproxy(T entity)
Unwrap the target instance from the proxy.
|
static <T> T |
deproxyOrNull(T entity)
Unwrap the target instance from the proxy if possible otherwise return null.
|
static java.lang.Class |
getClassWithoutInitializingProxy(java.lang.Object object)
Get the class of an instance or the underlying class
of a proxy (without initializing the proxy!).
|
static java.io.Serializable |
getIdentifierOf(java.lang.Object object) |
static boolean |
isInstanceOf(java.lang.Object object,
java.lang.Class clazz) |
public static <T> T deproxy(java.lang.Object object, java.lang.Class<T> clazz) throws java.lang.ClassCastException
null
. If object is not an instance of HibernateProxy no
deproxy is performed.object
- clazz
- java.lang.ClassCastException
public static <T> T deproxy(T entity)
org.hibernate.HibernateException
public static <T> T deproxyOrNull(T entity)
entity
- public static boolean isInstanceOf(java.lang.Object object, java.lang.Class clazz) throws java.lang.ClassCastException
java.lang.ClassCastException
public static java.io.Serializable getIdentifierOf(java.lang.Object object)
public static java.lang.Class getClassWithoutInitializingProxy(java.lang.Object object)
HibernateProxyHelper
Copyright © 2007-2020 EDIT. All Rights Reserved.