@@ -0,0 +1,1737 @@
+package org.slc.sli.domain;%0D%0A%0D%0Aimport java.util.HashMap;%0D%0Aimport java.util.Map;%0D%0A%0D%0Aimport org.bson.BasicBSONObject;%0D%0Aimport org.bson.types.ObjectId;%0D%0A%0D%0Aimport com.mongodb.BasicDBObject;%0D%0Aimport com.mongodb.DBObject;%0D%0A%0D%0Apublic class MongoEntity implements Entity %7B%0D%0A%0D%0A%09final String type;%0D%0A%09final String id;%0D%0A%09final Map%3CString, Object%3E body;%0D%0A%09final Map%3CString, Object%3E metaData;%0D%0A%0D%0A%09public MongoEntity(String type, String id, Map%3CString, Object%3E body,%0D%0A%09%09%09Map%3CString, Object%3E metaData) %7B%0D%0A%09%09if (body == null) %7B%0D%0A%09%09%09body = new BasicBSONObject();%0D%0A%09%09%7D%0D%0A%09%09if (metaData == null) %7B%0D%0A%09%09%09metaData = new BasicBSONObject();%0D%0A%09%09%7D%0D%0A%09%09this.type = type;%0D%0A%09%09this.id = id;%0D%0A%09%09this.body = body;%0D%0A%09%09this.metaData = metaData;%0D%0A%09%7D%0D%0A%0D%0A%09public String getId() %7B%0D%0A%09%09return id;%0D%0A%09%7D%0D%0A%0D%0A%09public String getType() %7B%0D%0A%09%09return type;%0D%0A%09%7D%0D%0A%0D%0A%09public Map%3CString, Object%3E getBody() %7B%0D%0A%09%09return body;%0D%0A%09%7D%0D%0A%0D%0A%09public DBObject toDBObject() %7B%0D%0A%09%09BasicDBObject dbObj = new BasicDBObject();%0D%0A%09%09dbObj.put(%22type%22, this.type);%0D%0A%09%09if (this.id != null) %7B%0D%0A%09%09%09dbObj.put(%22_id%22, new ObjectId(this.id));%0D%0A%09%09%7D%0D%0A%09%09dbObj.put(%22body%22, this.body);%0D%0A%09%09dbObj.put(%22metadata%22, this.metaData);%0D%0A%09%09return dbObj;%0D%0A%09%7D%0D%0A%0D%0A%09@SuppressWarnings(%22rawtypes%22)%0D%0A%09public static MongoEntity fromDBObject(DBObject dbObj) %7B%0D%0A%09%09String type = (String) dbObj.get(%22type%22);%0D%0A%09%09String id = ((ObjectId) dbObj.get(%22_id%22)).toString();%0D%0A%09%09Map map = dbObj.toMap();%0D%0A%09%09Map%3CString, Object%3E body = new HashMap%3CString, Object%3E();%0D%0A%09%09if (map.containsKey(%22body%22)) %7B%0D%0A%09%09%09body.putAll((Map) map.get(%22body%22));%0D%0A%09%09%7D%0D%0A%09%09Map%3CString, Object%3E metaData = new HashMap%3CString, Object%3E();%0D%0A%09%09if (map.containsKey(%22metadata%22)) %7B%0D%0A%09%09%09metaData.putAll((Map) map.get(%22metadata%22));%0D%0A%09%09%7D%0D%0A%09%09return new MongoEntity(type, id, body, metaData);%0D%0A%09%7D%0D%0A%0D%0A%7D%0D%0A

add mongo entity impl, changed enum entity type to string