that will look for the following keys (and expected
values):
| Key |
Required? |
Description |
| db |
Yes |
Instance of a configured com.mongodb.DB |
| uniqueIndexes |
No |
List of various MongoDB index values that will be ensured to exist and must be unique. |
| nonUniqueIndexes |
No |
List of various MongoDB index values that will be ensured to exist and need not be unique. |
| optimisticLockEnabled |
No |
Boolean to indicate if instances of the tracked type should be protected by a Jeppetto-managed lock version field. |
| shardKeyPattern |
No |
A comma-separated string of fields that are used to determine the shard key(s) for the collection. |
| saveNulls |
No |
Boolean to indicate whether null fields should be included in MongoDB documents. |
| writeConcern |
No |
String, one of the values as indicated at http://www.mongodb.org/display/DOCS/Replica+Set+Semantics. If
not specified, the DAO defaults to "SAFE". |
| showQueries |
No |
Boolean to indicate if executed queries should be logged. Note that logging will need to be enabled for
the DAO's package as well. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MongoDBQueryModelDAO
protected MongoDBQueryModelDAO(Class<T> entityClass,
Map<String,Object> daoProperties)
MongoDBQueryModelDAO
protected MongoDBQueryModelDAO(Class<T> entityClass,
Map<String,Object> daoProperties,
AccessControlContextProvider accessControlContextProvider)
findById
public T findById(ID id)
throws NoSuchItemException
- Specified by:
findById in interface GenericDAO<T,ID>
- Throws:
NoSuchItemException
findAll
public final Iterable<T> findAll()
- Specified by:
findAll in interface GenericDAO<T,ID>
save
public final void save(T entity)
- Specified by:
save in interface GenericDAO<T,ID>
delete
public final void delete(T entity)
- Specified by:
delete in interface GenericDAO<T,ID>
deleteById
public final void deleteById(ID id)
- Specified by:
deleteById in interface GenericDAO<T,ID>
flush
public final void flush()
- Specified by:
flush in interface GenericDAO<T,ID>
findUniqueUsingQueryModel
public T findUniqueUsingQueryModel(QueryModel queryModel)
throws NoSuchItemException
- Specified by:
findUniqueUsingQueryModel in interface QueryModelDAO<T,ID>
- Throws:
NoSuchItemException
findUsingQueryModel
public Iterable<T> findUsingQueryModel(QueryModel queryModel)
- Specified by:
findUsingQueryModel in interface QueryModelDAO<T,ID>
projectUsingQueryModel
public Object projectUsingQueryModel(QueryModel queryModel)
- Specified by:
projectUsingQueryModel in interface QueryModelDAO<T,ID>
buildCondition
public Condition buildCondition(String conditionField,
ConditionType conditionType,
Iterator argsIterator)
- Specified by:
buildCondition in interface QueryModelDAO<T,ID>
buildProjection
public Projection buildProjection(String projectionField,
ProjectionType projectionType,
Iterator argsIterator)
- Specified by:
buildProjection in interface QueryModelDAO<T,ID>
grantAccess
public void grantAccess(ID id,
String accessId)
- Specified by:
grantAccess in interface AccessControllable<ID>
revokeAccess
public void revokeAccess(ID id,
String accessId)
- Specified by:
revokeAccess in interface AccessControllable<ID>
getAccessIds
public List<String> getAccessIds(ID id)
- Specified by:
getAccessIds in interface AccessControllable<ID>
getAccessControlContextProvider
public AccessControlContextProvider getAccessControlContextProvider()
- Specified by:
getAccessControlContextProvider in interface AccessControllable<ID>
augmentObjectCacheKey
protected com.mongodb.DBObject augmentObjectCacheKey(com.mongodb.DBObject key)
- This method allows subclasses an opportunity to add any important data to a cache key, such
as the __acl from the AccessControlMongoDAO.
TODO: revsit these methods...
- Parameters:
key - key to augment
- Returns:
- augmented key
createIdentifyingQueries
protected com.mongodb.DBObject[] createIdentifyingQueries(com.mongodb.DBObject dbObject)
buildIdentifyingQuery
protected final com.mongodb.DBObject buildIdentifyingQuery(com.mongodb.DBObject dbObject)
buildIdentifyingQuery
protected final com.mongodb.DBObject buildIdentifyingQuery(ID id)
deleteByIdentifyingQuery
protected final void deleteByIdentifyingQuery(com.mongodb.DBObject identifyingQuery)
trueSave
protected final void trueSave(com.mongodb.DBObject identifyingQuery,
DirtyableDBObject dbo)
trueRemove
protected final void trueRemove(com.mongodb.DBObject identifyingQuery)
getDbCollection
protected final com.mongodb.DBCollection getDbCollection()
getCollectionClass
protected final Class<?> getCollectionClass()
Copyright © 2011. All Rights Reserved.