/* Write object, read it back and validate (compare) it. */
PersistEntityBinding entityBinding =
new PersistEntityBinding(catalog, entityCls.getName(), false);
entityBinding.objectToData(entity, dataEntry);
entityBinding.objectToKey(entity, keyEntry);
Object entity2 = entityBinding.entryToObject(keyEntry, dataEntry);
entity.validate(entity2);
/* Read back the primary key and validate it. */
PersistKeyBinding keyBinding =
new PersistKeyBinding(catalog, keyCls.getName(), false);