Compares two ids based on attributes.
If the result is less than 0 then the first id is less than the second,
if it is equal to 0 they are equal and
if the result is greater than 0 then the first is greater than the second.

Compares two ids based on parents.
If the result is less than 0 then the first id is less than the second,
if it is equal to 0 they are equal and
if the result is greater than 0 then the first is greater than the second.

Compares two ids based on parent entity ids and attributes.
If the result is less than 0 then the first id is less than the second,
if it is equal to 0 they are equal and
if the result is greater than 0 then the first is greater than the second.