/** * Find an object by the given id * * @param id The id * @return The object * @throws MongoException If an error occurred */ public T findOneById(K id) throws MongoException { return findOneById(id, (DBObject) null); }
/** * Find an object by the given id * * @param id The id * @return The object * @throws MongoException If an error occurred */ public T findOneById(K id) throws MongoException { return findOneById(id, (DBObject) null); }
@Override public T fetch() { if (object == null) { object = dbCollection.findOneById(getId()); } return object; }
@Override public T fetch(DBObject fields) { // No caching, because otherwise we'd have to track which fields were passed in return dbCollection.findOneById(getId(), fields); }
@Override public T fetch() { if (object == null) { object = dbCollection.findOneById(getId()); } return object; }
@Override public T fetch(DBObject fields) { // No caching, because otherwise we'd have to track which fields were passed in return dbCollection.findOneById(getId(), fields); }
/** * Find an object by the given id * * @param id The id * @return The object * @throws MongoException If an error occurred */ public T findOneById(K id, T fields) throws MongoException { return findOneById(id, convertToBasicDbObject(fields)); }
/** * Find an object by the given id * * @param id The id * @return The object * @throws MongoException If an error occurred */ public T findOneById(K id, T fields) throws MongoException { return findOneById(id, convertToBasicDbObject(fields)); }