// Special case entity pojos that become keys
if (value.getClass().isAnnotationPresent(Entity.class)) {
return factory().keys().getMetadataSafe(value).getRawKey(value);
} else {
// Run it through a translator
Translator<Object, Object> translator = factory().getTranslators().get(new TypeKey<>(value.getClass()), new CreateContext(factory()), Path.root());
return translator.save(value, false, new SaveContext(), Path.root());
}
}
}