The method is designed for comparing the entity key with the specified key.
function Compare(Key: TCustomKey): Integer;
The method compares the entity key value with the specified key value. The specified key has to be of the same meta-type as the entity. Otherwise, the exception will be raised. When the entity key is complex and consists of several entity attributes, each entity key attribute is compared with the corresponding key attribute. When all attributes are equal, the method returns zero. Otherwise, the method returns the result of the comparison of the first non-equal attribute pair.