use of org.apache.gora.mongodb.store.MongoMapping.DocumentFieldType in project gora by apache.
the class MongoStore method recordToMongo.
private BasicDBObject recordToMongo(final String docf, final Schema fieldSchema, final Object value) {
BasicDBObject record = new BasicDBObject();
for (Field member : fieldSchema.getFields()) {
Object innerValue = ((PersistentBase) value).get(member.pos());
String innerDoc = mapping.getDocumentField(member.name());
Type innerType = member.schema().getType();
DocumentFieldType innerStoreType = mapping.getDocumentFieldType(innerDoc);
LOG.debug("Transform value to DBObject (RECORD), docField:{}, schemaType:{}, storeType:{}", new Object[] { member.name(), member.schema().getType(), innerStoreType });
record.put(member.name(), toDBObject(docf, member.schema(), innerType, innerStoreType, innerValue));
}
return record;
}
Aggregations