try {
keyBytes = marshaller.objectToByteBuffer(key);
} catch (Exception e) {
throw new JpaStoreException("Failed to marshall key", e);
}
MetadataEntity metadata = findMetadata(em, new MetadataEntityKey(keyBytes));
if (metadata != null && metadata.getMetadata() != null) {
try {
m = (InternalMetadata) marshaller.objectFromByteBuffer(metadata.getMetadata());
} catch (Exception e) {
throw new JpaStoreException("Failed to unmarshall metadata", e);