// same type as the value of the field (e.g pass in the String form when using a UUID)
if (ammd.getType().isAssignableFrom(value.getClass())) {
TypeConverter strConv = typeMgr.getTypeConverterForType(ammd.getType(), String.class);
if (strConv != null) {
// Persist as String
value = strConv.toDatastoreType(value);
} else {
TypeConverter longConv = typeMgr.getTypeConverterForType(ammd.getType(), Long.class);
if (longConv != null) {
// Persist as Long
value = longConv.toDatastoreType(value);