Examples of toDatastoreType()


Examples of org.datanucleus.store.types.converters.TypeConverter.toDatastoreType()

    }

    if (ammd.getTypeConverterName() != null) {
      // User-defined type-converter
      TypeConverter conv = typeMgr.getTypeConverterForName(ammd.getTypeConverterName());
      value = conv.toDatastoreType(value);
    } else {
      // Perform conversion
      if (ammd.hasArray()) {
        value = convertPojoArrayToDatastoreValue(ammd, value);
      } else if (ammd.hasCollection()) {
View Full Code Here

Examples of org.datanucleus.store.types.converters.TypeConverter.toDatastoreType()

              // 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);
View Full Code Here

Examples of org.datanucleus.store.types.converters.TypeConverter.toDatastoreType()

                  value = strConv.toDatastoreType(value);
                } else {
                  TypeConverter longConv = typeMgr.getTypeConverterForType(ammd.getType(), Long.class);
                  if (longConv != null) {
                    // Persist as Long
                    value = longConv.toDatastoreType(value);
                  } else {
                    // Unsupported type on GAE/J ?
                    value = getPojoToDatastoreTypeFunc(Utils.identity(), ammd.getType()).apply(value);
                  }
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.