SecondaryKeyMetadata secKeyMeta =
entityMeta.getSecondaryKeys().get(keyName);
assertNotNull(secKeyMeta);
/* Create key creator/nullifier. */
SecondaryKeyCreator keyCreator = new PersistKeyCreator
(catalog, entityMeta, keyCls.getName(), secKeyMeta);
/* Convert entity to bytes. */
PersistEntityBinding entityBinding =
new PersistEntityBinding(catalog, entityCls.getName(), false);
entityBinding.objectToData(entity, dataEntry);
entityBinding.objectToKey(entity, keyEntry);
/* Extract secondary key bytes from entity bytes. */
DatabaseEntry secKeyEntry = new DatabaseEntry();
boolean isKeyPresent = keyCreator.createSecondaryKey
(null, keyEntry, dataEntry, secKeyEntry);
assertEquals(keyValue != null, isKeyPresent);
/* Convert secondary key bytes back to an object. */
PersistKeyBinding keyBinding =