public int compareTo(Object o) { assert o instanceof OrderKey; Member otherMember = ((OrderKey) o).member; final boolean thisCalculated = this.member.isCalculatedInQuery(); final boolean otherCalculated = otherMember.isCalculatedInQuery(); if (thisCalculated) { if (!otherCalculated) { return 1; } } else { if (otherCalculated) { return -1; } } final Comparable thisKey = this.member.getOrderKey(); final Comparable otherKey = otherMember.getOrderKey(); if ((thisKey != null) && (otherKey != null)) { return thisKey.compareTo(otherKey); } else { return this.member.compareTo(otherMember); } } }
final Comparable k1 = m1.getOrderKey(); final Comparable k2 = m2.getOrderKey(); if ((k1 != null) && (k2 != null)) { return k1.compareTo(k2);