/** * Compare two objects for DML operation. * * @param first First. * @param second Second. * @return Comparison result. */ @SuppressWarnings("unchecked") public static int compareForDml(Object first, Object second) { boolean firstBinary = first instanceof BinaryObjectImpl; boolean secondBinary = second instanceof BinaryObjectImpl; if (firstBinary) { if (secondBinary) return compareForDml0((BinaryObjectImpl)first, (BinaryObjectImpl)second); else return 1; // Go to the right part. } else { if (secondBinary) return -1; // Go to the left part. else return ((Comparable)first).compareTo(second); } }
/** * Compare two objects for DML operation. * * @param first First. * @param second Second. * @return Comparison result. */ @SuppressWarnings("unchecked") public static int compareForDml(Object first, Object second) { boolean firstBinary = first instanceof BinaryObjectImpl; boolean secondBinary = second instanceof BinaryObjectImpl; if (firstBinary) { if (secondBinary) return compareForDml0((BinaryObjectImpl)first, (BinaryObjectImpl)second); else return 1; // Go to the right part. } else { if (secondBinary) return -1; // Go to the left part. else return ((Comparable)first).compareTo(second); } }