public Person_login createPerson(Person_login p) { DBObject doc = PersonConverter.toDBObject(p); this.col.insert(doc); ObjectId id = (ObjectId) doc.get("_id"); p.setId(id.toString()); return p; }
public void updatePerson(Person_login p) { DBObject query = BasicDBObjectBuilder.start().append("_id", new ObjectId(p.getId())).get(); this.col.update(query, PersonConverter.toDBObject(p)); }