compareTo
Compares two AggregateId instances for ordering, first ensuring they belong to the same aggregate. If they don't belong to the same aggregate, an IllegalArgumentException is thrown. Otherwise, the comparison is based on the identifier.
Return
A negative integer if this is less than other, zero if equal, positive if greater. Follows the Comparable interface convention.
Parameters
other
The other AggregateId instance to compare with.
Throws
if the two AggregateIds don't belong to the same aggregate.