public class PersistedServiceImpl extends java.lang.Object implements PersistedService
| Modifier and Type | Field and Description |
|---|---|
MongoConnection |
mongoConnection |
| Modifier | Constructor and Description |
|---|---|
protected |
PersistedServiceImpl(MongoConnection mongoConnection) |
| Modifier and Type | Method and Description |
|---|---|
protected <T extends Persisted> |
collection(java.lang.Class<T> modelClass) |
protected <T extends Persisted> |
collection(T model) |
protected <T extends Persisted> |
count(java.lang.Class<T> modelClass,
com.mongodb.DBObject query) |
protected long |
count(com.mongodb.DBObject query,
java.lang.String collectionName) |
protected java.util.List<com.mongodb.DBObject> |
cursorToList(com.mongodb.DBCursor cursor) |
protected int |
destroy(com.mongodb.DBObject query,
java.lang.String collectionName) |
<T extends Persisted> |
destroy(T model) |
<T extends Persisted> |
destroyAll(java.lang.Class<T> modelClass) |
protected <T extends Persisted> |
destroyAll(java.lang.Class<T> modelClass,
com.mongodb.DBObject query) |
protected int |
destroyAll(java.lang.String collectionName) |
protected <T extends Persisted> |
embed(T model,
java.lang.String key,
EmbeddedPersistable o) |
protected <T extends Persisted> |
findOne(java.lang.Class<T> model,
com.mongodb.DBObject query) |
protected <T extends Persisted> |
findOne(java.lang.Class<T> model,
com.mongodb.DBObject query,
com.mongodb.DBObject sort) |
protected com.mongodb.DBObject |
findOne(com.mongodb.DBObject query,
com.mongodb.DBObject sort,
java.lang.String collectioName) |
protected com.mongodb.DBObject |
findOne(com.mongodb.DBObject query,
java.lang.String collectionName) |
protected <T extends Persisted> |
get(java.lang.Class<T> modelClass,
org.bson.types.ObjectId id) |
protected <T extends Persisted> |
get(java.lang.Class<T> modelClass,
java.lang.String id) |
protected com.mongodb.DBObject |
get(org.bson.types.ObjectId id,
java.lang.String collectionName) |
protected <T extends Persisted> |
query(java.lang.Class<T> modelClass,
com.mongodb.DBObject query) |
protected <T extends Persisted> |
query(java.lang.Class<T> modelClass,
com.mongodb.DBObject query,
com.mongodb.DBObject sort) |
protected <T extends Persisted> |
query(java.lang.Class<T> modelClass,
com.mongodb.DBObject query,
com.mongodb.DBObject sort,
int limit,
int offset) |
protected java.util.List<com.mongodb.DBObject> |
query(com.mongodb.DBObject query,
com.mongodb.DBCollection collection) |
protected java.util.List<com.mongodb.DBObject> |
query(com.mongodb.DBObject query,
java.lang.String collectionName) |
protected <T extends Persisted> |
removeEmbedded(T model,
java.lang.String key,
java.lang.String searchId) |
protected <T extends Persisted> |
removeEmbedded(T model,
java.lang.String arrayKey,
java.lang.String key,
java.lang.String searchId) |
<T extends Persisted> |
save(T model) |
<T extends Persisted> |
saveWithoutValidation(T model) |
protected <T extends Persisted> |
totalCount(java.lang.Class<T> modelClass) |
protected long |
totalCount(java.lang.String collectionName) |
java.util.Map<java.lang.String,java.util.List<ValidationResult>> |
validate(java.util.Map<java.lang.String,Validator> validators,
java.util.Map<java.lang.String,java.lang.Object> fields) |
<T extends Persisted> |
validate(T model) |
<T extends Persisted> |
validate(T model,
java.util.Map<java.lang.String,java.lang.Object> fields) |
public final MongoConnection mongoConnection
protected PersistedServiceImpl(MongoConnection mongoConnection)
protected com.mongodb.DBObject get(org.bson.types.ObjectId id,
java.lang.String collectionName)
protected <T extends Persisted> com.mongodb.DBObject get(java.lang.Class<T> modelClass, org.bson.types.ObjectId id)
protected <T extends Persisted> com.mongodb.DBObject get(java.lang.Class<T> modelClass, java.lang.String id)
protected java.util.List<com.mongodb.DBObject> query(com.mongodb.DBObject query,
java.lang.String collectionName)
protected java.util.List<com.mongodb.DBObject> query(com.mongodb.DBObject query,
com.mongodb.DBCollection collection)
protected <T extends Persisted> java.util.List<com.mongodb.DBObject> query(java.lang.Class<T> modelClass, com.mongodb.DBObject query)
protected <T extends Persisted> java.util.List<com.mongodb.DBObject> query(java.lang.Class<T> modelClass, com.mongodb.DBObject query, com.mongodb.DBObject sort)
protected <T extends Persisted> java.util.List<com.mongodb.DBObject> query(java.lang.Class<T> modelClass, com.mongodb.DBObject query, com.mongodb.DBObject sort, int limit, int offset)
protected long count(com.mongodb.DBObject query,
java.lang.String collectionName)
protected <T extends Persisted> long count(java.lang.Class<T> modelClass, com.mongodb.DBObject query)
protected <T extends Persisted> com.mongodb.DBCollection collection(java.lang.Class<T> modelClass)
protected <T extends Persisted> com.mongodb.DBCollection collection(T model)
protected java.util.List<com.mongodb.DBObject> cursorToList(com.mongodb.DBCursor cursor)
protected <T extends Persisted> com.mongodb.DBObject findOne(java.lang.Class<T> model, com.mongodb.DBObject query)
protected <T extends Persisted> com.mongodb.DBObject findOne(java.lang.Class<T> model, com.mongodb.DBObject query, com.mongodb.DBObject sort)
protected com.mongodb.DBObject findOne(com.mongodb.DBObject query,
java.lang.String collectionName)
protected com.mongodb.DBObject findOne(com.mongodb.DBObject query,
com.mongodb.DBObject sort,
java.lang.String collectioName)
protected long totalCount(java.lang.String collectionName)
protected <T extends Persisted> long totalCount(java.lang.Class<T> modelClass)
public <T extends Persisted> int destroy(T model)
destroy in interface PersistedServicepublic <T extends Persisted> int destroyAll(java.lang.Class<T> modelClass)
destroyAll in interface PersistedServiceprotected int destroyAll(java.lang.String collectionName)
protected int destroy(com.mongodb.DBObject query,
java.lang.String collectionName)
protected <T extends Persisted> int destroyAll(java.lang.Class<T> modelClass, com.mongodb.DBObject query)
public <T extends Persisted> java.lang.String save(T model) throws ValidationException
save in interface PersistedServiceValidationExceptionpublic <T extends Persisted> java.lang.String saveWithoutValidation(T model)
saveWithoutValidation in interface PersistedServicepublic <T extends Persisted> java.util.Map<java.lang.String,java.util.List<ValidationResult>> validate(T model, java.util.Map<java.lang.String,java.lang.Object> fields)
validate in interface PersistedServicepublic java.util.Map<java.lang.String,java.util.List<ValidationResult>> validate(java.util.Map<java.lang.String,Validator> validators, java.util.Map<java.lang.String,java.lang.Object> fields)
validate in interface PersistedServicepublic <T extends Persisted> java.util.Map<java.lang.String,java.util.List<ValidationResult>> validate(T model)
validate in interface PersistedServiceprotected <T extends Persisted> void embed(T model, java.lang.String key, EmbeddedPersistable o) throws ValidationException
ValidationExceptionprotected <T extends Persisted> void removeEmbedded(T model, java.lang.String key, java.lang.String searchId)
protected <T extends Persisted> void removeEmbedded(T model, java.lang.String arrayKey, java.lang.String key, java.lang.String searchId)
Copyright © 2012-2014 TORCH GmbH. All Rights Reserved.