| Modifier and Type | Method and Description |
|---|---|
long |
count() |
long |
count(Query<T> query) |
long |
count(String key,
Object value) |
Query<T> |
createQuery()
Starts a query for this DAO entities type
|
UpdateOperations<T> |
createUpdateOperations()
Starts a update-operations def for this DAO entities type
|
WriteResult |
delete(T entity)
Deletes an entity
|
WriteResult |
delete(T entity,
WriteConcern wc)
Deletes an entity
|
WriteResult |
deleteById(K id)
Delete the entity by id value
|
WriteResult |
deleteByQuery(Query<T> query)
Delete the entity matching a query
|
void |
ensureIndexes()
ensures indexed for this DAO
|
boolean |
exists(Query<T> query)
checks for entities which match the criteria
|
boolean |
exists(String key,
Object value)
checks for entities which match criteria {key:value}
|
QueryResults<T> |
find()
Finds all the documents in the collection mapped by the entity class
|
QueryResults<T> |
find(Query<T> query)
Finds entities matching a query
|
List<K> |
findIds()
Finds the entities Ts
|
List<K> |
findIds(Query<T> query)
Finds the entities Ts by the criteria {key:value}
|
List<K> |
findIds(String key,
Object value)
Finds the entities Key
|
T |
findOne(Query<T> query)
Finds the first entity matching the query.
|
T |
findOne(String key,
Object value)
Finds the first entity matching the query.
|
Key<T> |
findOneId()
Finds the first entity's ID
|
Key<T> |
findOneId(Query<T> query)
Finds the first entity's ID
|
Key<T> |
findOneId(String key,
Object value)
Finds the first entity's ID matching a query
|
T |
get(K id)
Loads the entity by id value
|
DBCollection |
getCollection() |
Datastore |
getDatastore() |
Class<T> |
getEntityClass()
The type of entities for this DAO
|
Key<T> |
save(T entity)
Saves the entity; either inserting or overriding the existing document
|
Key<T> |
save(T entity,
WriteConcern wc)
Saves the entity; either inserting or overriding the existing document
|
UpdateResults |
update(Query<T> query,
UpdateOperations<T> ops)
Updates all entities matched by the constraints with the modifiers supplied.
|
UpdateResults |
updateFirst(Query<T> query,
UpdateOperations<T> ops)
Updates the first entity matched by the constraints with the modifiers supplied.
|
long count()
long count(String key, Object value)
key - The key to search withvalue - the value to look forlong count(Query<T> query)
query - the query to use when countingUpdateOperations<T> createUpdateOperations()
WriteResult delete(T entity)
entity - the entity to deleteWriteResultWriteResult delete(T entity, WriteConcern wc)
entity - the entity to deletewc - the WriteConcern to use when deletingWriteConcern,
WriteResultWriteResult deleteById(K id)
id - the ID of the document to deleteWriteResultWriteResult deleteByQuery(Query<T> query)
query - the query to use when finding the documents to deleteWriteResultvoid ensureIndexes()
boolean exists(String key, Object value)
key - the key to queryvalue - the value to search forboolean exists(Query<T> query)
query - the query to use when finding the documentsQueryResults<T> find()
getEntityClass()QueryResults<T> find(Query<T> query)
query - the query to use when finding the documentsList<K> findIds(String key, Object value)
key - the key to queryvalue - the value to search forList<K> findIds(Query<T> query)
query - the query to use when finding the documentsT findOne(String key, Object value)
key - the key to queryvalue - the value to search forT findOne(Query<T> query)
query - the query to use when finding the documentsKey<T> findOneId(String key, Object value)
key - the key to queryvalue - the value to search forKey<T> findOneId(Query<T> query)
query - the query to use when finding the documentsT get(K id)
id - the ID to search forDBCollection getCollection()
getEntityClass()Datastore getDatastore()
Class<T> getEntityClass()
Key<T> save(T entity)
entity - the entity to saveKey<T> save(T entity, WriteConcern wc)
entity - the entity to savewc - the WriteConcern to use when savingWriteConcernUpdateResults update(Query<T> query, UpdateOperations<T> ops)
query - the query used to match the documents to updateops - the update operations to performUpdateResults updateFirst(Query<T> query, UpdateOperations<T> ops)
query - the query used to match the document to updateops - the update operations to perform