code: private boolean compareTo(Object relationalEntity, Object originalEntity)
      {
          if (relationalEntity != null && originalEntity != null
                  && relationalEntity.getClass().isAssignableFrom(originalEntity.getClass()))
          {
              EntityMetadata metadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata,
                      originalEntity.getClass());
  
              Object relationalEntityId = PropertyAccessorHelper.getId(relationalEntity, metadata);
              Object originalEntityId = PropertyAccessorHelper.getId(originalEntity, metadata);
  
              return relationalEntityId.equals(originalEntityId);
          }
  
          return false;
      }
docs: Compares original with relational entity.
  
  @param relationalEntity
  @param originalEntity
  @return