I'm trying to figure out the advantage of Jongo over simply unmarshalling the json command using (DBObject)JSON.parse(...) and using the DBObject in the below fashion.
Is there a performance advantage?
@Override
public List<T> getEntityList(Integer limit, String query) throws Exception {
log.entering(DaoImpl.class.toString(), "getEntityList, with criteria of " + query);
DBObject criteriaObject = null;
ArrayList<T> list = new ArrayList<T>();
if (query != null)
criteriaObject = (DBObject)JSON.parse(query);
DBCursor cursor = null;
try {
if (criteriaObject != null) {
log.log(Level.FINEST, "getting the objects using a search criteria: " + criteriaObject);
cursor = MongoDB.getInstance().getCollection(collection).find(criteriaObject);
} else {
log.log(Level.FINEST, "getting the objects without a criteria");
cursor = MongoDB.getInstance().getCollection(collection).find();
}
............etc, etc, etc
Thanks!