| Constructor and Description |
|---|
WriterImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
delete(List lst) |
void |
delete(Object o) |
void |
delete(Query q)
deletes all objects matching the given query
|
void |
inc(Object toInc,
String field,
int amount)
Increases a value in an existing mongo collection entry - no reading necessary.
|
void |
inc(Query<?> query,
String field,
int amount,
boolean insertIfNotExist,
boolean multiple) |
void |
pushPull(boolean push,
Query<?> query,
String field,
Object value,
boolean insertIfNotExist,
boolean multiple) |
void |
pushPullAll(boolean push,
Query<?> query,
String field,
List<?> value,
boolean insertIfNotExist,
boolean multiple) |
void |
set(Object toSet,
String field,
Object value)
changes an object in DB
|
void |
set(Query<?> query,
Map<String,Object> values,
boolean insertIfNotExist,
boolean multiple)
will change an entry in mongodb-collection corresponding to given class object
if query is too complex, upsert might not work!
|
void |
setMorphium(Morphium m) |
void |
store(List lst)
stores the given list of objects, should be entities or embedded
|
void |
store(Object o)
Stores the object, should be an entity
|
void |
storeUsingFields(Object ent,
String... fields)
update an object using fields specified
|
void |
unset(Object toSet,
String field)
Un-setting a value in an existing mongo collection entry - no reading necessary.
|
public void setMorphium(Morphium m)
setMorphium in interface Writerpublic void store(Object o)
Writerpublic void store(List lst)
Writerpublic void storeUsingFields(Object ent, String... fields)
WriterstoreUsingFields in interface Writerpublic void delete(Query q)
public void inc(Object toInc, String field, int amount)
public void inc(Query<?> query, String field, int amount, boolean insertIfNotExist, boolean multiple)
public void set(Query<?> query, Map<String,Object> values, boolean insertIfNotExist, boolean multiple)
set in interface Writerquery - - query to specify which objects should be setvalues - - map fieldName->Value, which values are to be set!insertIfNotExist - - insert, if it does not exist (query needs to be simple!)multiple - - update several documents, if false, only first hit will be updatedpublic void unset(Object toSet, String field)
public void pushPull(boolean push,
Query<?> query,
String field,
Object value,
boolean insertIfNotExist,
boolean multiple)
public void pushPullAll(boolean push,
Query<?> query,
String field,
List<?> value,
boolean insertIfNotExist,
boolean multiple)
pushPullAll in interface WriterCopyright © 2012. All Rights Reserved.