|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.unitils.reflectionassert.util.HibernateUtil
public class HibernateUtil
Utility class for handling Hibernate proxies during the comparison.
Every operation is performed through reflection to avoid a direct link to Hibernate. This way you do not need Hibernate in the classpath to use the reflection comparator.
| Field Summary | |
|---|---|
protected static Class<?> |
hibernateProxyClass
The hibernate proxy type, null if the class is not found in the classpath |
| Constructor Summary | |
|---|---|
HibernateUtil()
|
|
| Method Summary | |
|---|---|
static String |
getEntitiyName(Object object)
Gets the class name of the proxied object |
static Object |
getIdentifier(Object object)
Gets the unique identifier of the given proxy object. |
static Object |
getUnproxiedValue(Object object)
Gets (and loads) the wrapped object out of a given hibernate proxy. |
protected static Object |
invokeLazyInitializerMethod(String methodName,
Object proxy)
Invokes the given method on the LazyInitializer that is associated with the given proxy. |
static boolean |
isHibernateProxy(Object object)
Checks whether the given ojbect is a HibernateProxy instance. |
static boolean |
isUninitialized(Object object)
Checks whether the given proxy object has been loaded. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static Class<?> hibernateProxyClass
| Constructor Detail |
|---|
public HibernateUtil()
| Method Detail |
|---|
public static boolean isHibernateProxy(Object object)
object - The object
public static boolean isUninitialized(Object object)
object - The object or proxy
public static String getEntitiyName(Object object)
object - The object or proxy
public static Object getIdentifier(Object object)
object - The object or proxy
public static Object getUnproxiedValue(Object object)
object - The object or proxy
protected static Object invokeLazyInitializerMethod(String methodName,
Object proxy)
methodName - The method to invoke, not nullproxy - The hibernate proxy instance, not null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||