|
||||||||||
| 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 java.lang.Class<?> |
hibernateProxyClass
The hibernate proxy type, null if the class is not found in the classpath |
| Constructor Summary | |
|---|---|
HibernateUtil()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
getEntitiyName(java.lang.Object object)
Gets the class name of the proxied object |
static java.lang.Object |
getIdentifier(java.lang.Object object)
Gets the unique identifier of the given proxy object. |
static java.lang.Object |
getUnproxiedValue(java.lang.Object object)
Gets (and loads) the wrapped object out of a given hibernate proxy. |
protected static java.lang.Object |
invokeLazyInitializerMethod(java.lang.String methodName,
java.lang.Object proxy)
Invokes the given method on the LazyInitializer that is associated with the given proxy. |
static boolean |
isHibernateProxy(java.lang.Object object)
Checks whether the given ojbect is a HibernateProxy instance. |
static boolean |
isUninitialized(java.lang.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 java.lang.Class<?> hibernateProxyClass
| Constructor Detail |
|---|
public HibernateUtil()
| Method Detail |
|---|
public static boolean isHibernateProxy(java.lang.Object object)
object - The object
public static boolean isUninitialized(java.lang.Object object)
object - The object or proxy
public static java.lang.String getEntitiyName(java.lang.Object object)
object - The object or proxy
public static java.lang.Object getIdentifier(java.lang.Object object)
object - The object or proxy
public static java.lang.Object getUnproxiedValue(java.lang.Object object)
object - The object or proxy
protected static java.lang.Object invokeLazyInitializerMethod(java.lang.String methodName,
java.lang.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 | |||||||||