@Test public void testFromMongoMap_null() throws Exception { MongoStore store = new MongoStore(); Document noField = new Document(); String field = "myField"; Object item = store.fromMongoMap(field, null, new BSONDecorator(noField), null); assertNotNull(item); }
Object fromMongoMap(final String docf, final Schema fieldSchema, final BSONDecorator easybson, final Field f) throws GoraException { Document map = easybson.getDBObject(docf); Map<Utf8, Object> rmap = new HashMap<>(); if (map == null) { return new DirtyMapWrapper(rmap); } for (Entry<String, Object> e : map.entrySet()) { String mapKey = e.getKey(); String decodedMapKey = decodeFieldKey(mapKey); DocumentFieldType storeType = mapping.getDocumentFieldType(docf); Object o = fromDocument(fieldSchema.getValueType(), storeType, f, mapKey, new BSONDecorator(map)); rmap.put(new Utf8(decodedMapKey), o); } return new DirtyMapWrapper<>(rmap); }
MongoStore extends
DataStoreBase<K, T> { Object fromMongoMap(final String docf, final Schema fieldSchema, final BSONDecorator easybson, final Field f) throws GoraException { Document map = easybson.getDBObject(docf); Map<Utf8, Object> rmap = new HashMap<>(); if (map == null) { return new DirtyMapWrapper(rmap); } for (Entry<String, Object> e : map.entrySet()) { String mapKey = e.getKey(); String decodedMapKey = decodeFieldKey(mapKey); DocumentFieldType storeType = mapping.getDocumentFieldType(docf); Object o = fromDocument(fieldSchema.getValueType(), storeType, f, mapKey, new BSONDecorator(map)); rmap.put(new Utf8(decodedMapKey), o); } return new DirtyMapWrapper<>(rmap); } }
MongoStore extends
DataStoreBase<K, T> { Object fromMongoMap(final String docf, final Schema fieldSchema, final BSONDecorator easybson, final Field f) throws GoraException { Document map = easybson.getDBObject(docf); Map<Utf8, Object> rmap = new HashMap<>(); if (map == null) { return new DirtyMapWrapper(rmap); } for (Entry<String, Object> e : map.entrySet()) { String mapKey = e.getKey(); String decodedMapKey = decodeFieldKey(mapKey); DocumentFieldType storeType = mapping.getDocumentFieldType(docf); Object o = fromDocument(fieldSchema.getValueType(), storeType, f, mapKey, new BSONDecorator(map)); rmap.put(new Utf8(decodedMapKey), o); } return new DirtyMapWrapper<>(rmap); } MongoStore(); }
MongoStore extends
DataStoreBase<K, T> { Object fromMongoMap(final String docf, final Schema fieldSchema, final BSONDecorator easybson, final Field f) throws GoraException { Document map = easybson.getDBObject(docf); Map<Utf8, Object> rmap = new HashMap<>(); if (map == null) { return new DirtyMapWrapper(rmap); } for (Entry<String, Object> e : map.entrySet()) { String mapKey = e.getKey(); String decodedMapKey = decodeFieldKey(mapKey); DocumentFieldType storeType = mapping.getDocumentFieldType(docf); Object o = fromDocument(fieldSchema.getValueType(), storeType, f, mapKey, new BSONDecorator(map)); rmap.put(new Utf8(decodedMapKey), o); } return new DirtyMapWrapper<>(rmap); } MongoStore(); void initialize(final Class<K> keyClass,
      final Class<T> pPersistentClass, final Properties properties); MongoMapping getMapping(); @Override String getSchemaName(); @Override String getSchemaName(final String mappingSchemaName,
      final Class<?> persistentClass); @Override void createSchema(); @Override void deleteSchema(); @Override boolean schemaExists(); @Override void flush(); @Override void close(); @Override T get(final K key, final String[] fields); @Override boolean exists(final K key); @Override void put(final K key, final T obj); @Override boolean delete(final K key); @Override long deleteByQuery(final Query<K, T> query); @Override Result<K, T> execute(final Query<K, T> query); @Override Query<K, T> newQuery(); @Override List<PartitionQuery<K, T>> getPartitions(final Query<K, T> query); T newInstance(final Document obj, final String[] fields); String encodeFieldKey(final String key); String decodeFieldKey(final String key); }
MongoStore extends
DataStoreBase<K, T> { Object fromMongoMap(final String docf, final Schema fieldSchema, final BSONDecorator easybson, final Field f) throws GoraException { Document map = easybson.getDBObject(docf); Map<Utf8, Object> rmap = new HashMap<>(); if (map == null) { return new DirtyMapWrapper(rmap); } for (Entry<String, Object> e : map.entrySet()) { String mapKey = e.getKey(); String decodedMapKey = decodeFieldKey(mapKey); DocumentFieldType storeType = mapping.getDocumentFieldType(docf); Object o = fromDocument(fieldSchema.getValueType(), storeType, f, mapKey, new BSONDecorator(map)); rmap.put(new Utf8(decodedMapKey), o); } return new DirtyMapWrapper<>(rmap); } MongoStore(); void initialize(final Class<K> keyClass,
      final Class<T> pPersistentClass, final Properties properties); MongoMapping getMapping(); @Override String getSchemaName(); @Override String getSchemaName(final String mappingSchemaName,
      final Class<?> persistentClass); @Override void createSchema(); @Override void deleteSchema(); @Override boolean schemaExists(); @Override void flush(); @Override void close(); @Override T get(final K key, final String[] fields); @Override boolean exists(final K key); @Override void put(final K key, final T obj); @Override boolean delete(final K key); @Override long deleteByQuery(final Query<K, T> query); @Override Result<K, T> execute(final Query<K, T> query); @Override Query<K, T> newQuery(); @Override List<PartitionQuery<K, T>> getPartitions(final Query<K, T> query); T newInstance(final Document obj, final String[] fields); String encodeFieldKey(final String key); String decodeFieldKey(final String key); static final Logger LOG; static final String DEFAULT_MAPPING_FILE; }