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
Constructors Constructor Description DefaultUpdateComparator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(com.broadleafcommerce.data.tracking.core.service.Update<I> o1, com.broadleafcommerce.data.tracking.core.service.Update<I> o2)
-
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
-
-
-
-
Method Detail
-
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>
-
-