org.test4j.hamcrest.matcher.property.comparator
类 HibernateProxyComparator
java.lang.Object
org.test4j.hamcrest.matcher.property.comparator.HibernateProxyComparator
- 所有已实现的接口:
- Comparator
public class HibernateProxyComparator
- extends Object
- implements Comparator
Comparator that can handle Hibernate proxies.
Special thanks to Tim Peeters for helping us with the implementation.
| 从类 java.lang.Object 继承的方法 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HibernateProxyComparator
public HibernateProxyComparator()
canCompare
public boolean canCompare(Object left,
Object right)
- Returns true if one or both of the objects is a Hibernate proxy.
- 指定者:
- 接口
Comparator 中的 canCompare
- 参数:
left - The left objectright - The right object
- 返回:
- True if one is a proxy
compare
public Difference compare(Object left,
Object right,
boolean onlyFirstDifference,
ReflectionComparator reflectionComparator)
- Compares the given objects. If one of the objects is a proxy, the proxy is initialized and the wrapped values
are compared. If both objects are proxies and both objects are not yet loaded (initialized) only the idendtifiers
are compared. This avoids performing unnecessary loads from the database (potentially retrieving a huge
amount of data). If the ids of the proxies are identical, the objects are considered identical, if not the
objects are considered different.
- 指定者:
- 接口
Comparator 中的 compare
- 参数:
left - The left object, not nullright - The right object, not nullonlyFirstDifference - True if only the first difference should be returnedreflectionComparator - The root comparator for inner comparisons, not null
- 返回:
- A ObjectDifference or null if both maps are equal
Copyright © 2013. All rights reserved.