@Override public boolean isSimpleType(Class propType) { if (propType == null) return false; if (propType.isArray()) { return isSimpleType(propType.getComponentType()) || super.isSimpleType(propType); } return isMongoNativeType(propType) || super.isSimpleType(propType); }
/** * Check whether a type is a native mongo type that can be stored by the mongo driver without * conversion. * * @param clazz The class to check. * @return true if no conversion is required and the type can be stored natively. */ public static boolean isMongoNativeType(Class clazz) { return MongoMappingContext.MONGO_NATIVE_TYPES.contains(clazz.getName()) || DBObject.class.isAssignableFrom(clazz.getClass()); }