Class DefaultUpdateComparator<I>
java.lang.Object
com.broadleafcommerce.inventory.service.DefaultUpdateComparator<I>
- Type Parameters:
I
-
- All Implemented Interfaces:
Comparator<com.broadleafcommerce.data.tracking.core.service.Update<I>>
public class DefaultUpdateComparator<I>
extends Object
implements Comparator<com.broadleafcommerce.data.tracking.core.service.Update<I>>
Provides a comparator to order update items by their ID to avoid deadlocks in RDBMS systems where
multiple updates occur with pessimistic locking inside a single transaction.
- Author:
- Kelly Tisdell (ktisdell)
-
Constructor Summary
-
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
DefaultUpdateComparator
public DefaultUpdateComparator()
-
-
Method Details
-
compare
public int compare(com.broadleafcommerce.data.tracking.core.service.Update<I> o1, com.broadleafcommerce.data.tracking.core.service.Update<I> o2) - Specified by:
compare
in interfaceComparator<I>
-