public class Morphium extends Object implements AutoCloseable
| Constructor and Description |
|---|
Morphium() |
Morphium(MorphiumConfig cfg)
init the MongoDbLayer.
|
Morphium(String host,
int port,
String db) |
Morphium(String host,
String db) |
| Modifier and Type | Method and Description |
|---|---|
void |
abortTransaction() |
void |
addClusterListener(com.mongodb.event.ClusterListener cl) |
void |
addCommandListener(com.mongodb.event.CommandListener cmd) |
void |
addConnectionPoolListener(com.mongodb.event.ConnectionPoolListener cpl) |
void |
addListener(MorphiumStorageListener lst) |
void |
addProfilingListener(ProfilingListener l) |
void |
addReplicasetStatusListener(ReplicasetStatusListener lst) |
void |
addShutdownListener(ShutdownListener l) |
Map<Class<?>,List<Map<String,Object>>> |
checkIndices()
run trhough classpath, find all Entities, check indices
returns a list of Entities, whos indices are missing or different
|
Map<Class<?>,List<Map<String,Object>>> |
checkIndices(io.github.classgraph.ClassInfoList.ClassInfoFilter filter) |
void |
clearCachefor(Class<?> cls)
Erase cache entries for the given type. is being called after every store
depending on cache settings!
|
void |
clearCacheforClassIfNecessary(Class<?> cls) |
void |
clearCollection(Class<?> cls)
issues a remove command - no lifecycle methods calles, no drop, keeps all indexec this way
|
void |
clearCollection(Class<?> cls,
String colName)
issues a remove command - no lifecycle methods calles, no drop, keeps all indexec this way
But uses sepcified collection name instead deriving name from class
|
void |
clearCollectionOneByOne(Class<?> cls)
clears every single object in collection - reads ALL objects to do so
this way Lifecycle methods can be called!
|
void |
close() |
void |
commitTransaction() |
<T> void |
convertToCapped(Class<T> c,
int size,
AsyncOperationCallback<T> cb)
converts the given type to capped collection in Mongo, even if no @capped is defined!
|
<T> void |
convertToCapped(String coll,
int size,
AsyncOperationCallback<T> cb) |
<T,R> Aggregator<T,R> |
createAggregator(Class<? extends T> type,
Class<? extends R> resultType) |
MorphiumBulkContext |
createBulkRequestContext(Class<?> type,
boolean ordered) |
MorphiumBulkContext |
createBulkRequestContext(String collection,
boolean ordered) |
String |
createCamelCase(String n) |
List<Map<String,Object>> |
createIndexMapFrom(String[] fldStr) |
<T> T |
createLazyLoadedEntity(Class<? extends T> cls,
Object id,
String collectionName) |
Query<Map<String,Object>> |
createMapQuery(String collection) |
<T> MongoField<T> |
createMongoField() |
<T> Query<T> |
createQueryByTemplate(T template,
Enum... fields) |
<T> Query<T> |
createQueryByTemplate(T template,
String... fields) |
<T> Query<T> |
createQueryFor(Class<? extends T> type) |
<T> Query<T> |
createQueryFor(Class<? extends T> type,
String usingCollectionName) |
<T> void |
currentDate(Query<?> query,
Enum field,
boolean upsert,
boolean multiple) |
<T> void |
currentDate(Query<?> query,
String field,
boolean upsert,
boolean multiple)
set current date into one field
|
<T> void |
dec(Map<Enum,Number> fieldsToInc,
Query<T> matching,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> callback) |
void |
dec(Object toDec,
Enum field,
double amount)
decreasing a value of a given object
calles
inc(toDec,field,-amount); |
void |
dec(Object toDec,
Enum field,
int amount) |
void |
dec(Object toDec,
Enum field,
long amount) |
void |
dec(Object toDec,
Enum field,
Number amount) |
void |
dec(Object toDec,
String field,
double amount) |
void |
dec(Object toDec,
String field,
int amount) |
void |
dec(Object toDec,
String field,
long amount) |
void |
dec(Object toDec,
String field,
Number amount) |
void |
dec(Query<?> query,
Enum field,
double amount) |
void |
dec(Query<?> query,
Enum field,
double amount,
boolean upsert,
boolean multiple) |
void |
dec(Query<?> query,
Enum field,
int amount) |
void |
dec(Query<?> query,
Enum field,
int amount,
boolean upsert,
boolean multiple) |
void |
dec(Query<?> query,
Enum field,
long amount) |
void |
dec(Query<?> query,
Enum field,
long amount,
boolean upsert,
boolean multiple) |
void |
dec(Query<?> query,
Enum field,
Number amount) |
void |
dec(Query<?> query,
Enum field,
Number amount,
boolean upsert,
boolean multiple) |
void |
dec(Query<?> query,
String field,
double amount) |
void |
dec(Query<?> query,
String field,
double amount,
boolean upsert,
boolean multiple) |
void |
dec(Query<?> query,
String field,
int amount) |
void |
dec(Query<?> query,
String field,
int amount,
boolean upsert,
boolean multiple) |
void |
dec(Query<?> query,
String field,
long amount) |
void |
dec(Query<?> query,
String field,
long amount,
boolean upsert,
boolean multiple) |
void |
dec(Query<?> query,
String field,
Number amount) |
void |
dec(Query<?> query,
String field,
Number amount,
boolean upsert,
boolean multiple) |
<T> void |
dec(Query<T> query,
Enum field,
double amount,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> callback) |
<T> void |
dec(Query<T> query,
Enum field,
int amount,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> callback) |
<T> void |
dec(Query<T> query,
Enum field,
long amount,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> callback) |
<T> void |
dec(Query<T> query,
Enum field,
Number amount,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> callback) |
<T> void |
dec(Query<T> query,
Map<String,Number> toUpdate,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> callback) |
<T> void |
dec(Query<T> query,
String name,
double amount,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> callback) |
<T> void |
dec(Query<T> query,
String name,
int amount,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> callback) |
<T> void |
dec(Query<T> query,
String name,
long amount,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> callback) |
<T> void |
dec(Query<T> query,
String name,
Number amount,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> callback) |
<T> void |
delete(List<T> lst,
AsyncOperationCallback<T> callback) |
<T> void |
delete(List<T> lst,
String forceCollectionName) |
<T> void |
delete(List<T> lst,
String forceCollectionName,
AsyncOperationCallback<T> callback) |
void |
delete(Object o)
deletes a single object from morphium backend.
|
void |
delete(Object o,
String collection) |
<T> void |
delete(Query<T> o) |
<T> void |
delete(Query<T> o,
AsyncOperationCallback<T> callback) |
<T> void |
delete(T lo,
AsyncOperationCallback<T> callback) |
<T> void |
delete(T lo,
String collection,
AsyncOperationCallback<T> callback) |
<T> T |
deReference(T obj)
de-references the given object of type T.
|
void |
disableAsyncWritesForThread() |
void |
disableAutoValuesForThread() |
void |
disableReadCacheForThread() |
void |
disableValidation() |
void |
disableWriteBufferForThread() |
List<Object> |
distinct(Enum key,
Class c) |
List<Object> |
distinct(Enum key,
Query q)
returns a distinct list of values of the given collection
Attention: these values are not unmarshalled, you might get MongoMap
|
List<Object> |
distinct(String key,
Class cls) |
List<Object> |
distinct(String key,
Class cls,
Collation collation) |
List<Object> |
distinct(String key,
Query q)
returns a distinct list of values of the given collection
Attention: these values are not unmarshalled, you might get MongoMap
|
List<Object> |
distinct(String key,
String collectionName) |
List<Object> |
distinct(String key,
String collectionName,
Collation collation) |
void |
dropCollection(Class<?> cls) |
<T> void |
dropCollection(Class<T> cls,
AsyncOperationCallback<T> callback) |
<T> void |
dropCollection(Class<T> cls,
String collection,
AsyncOperationCallback<T> callback) |
void |
enableAsyncWritesForThread() |
void |
enableAutoValuesForThread() |
void |
enableReadCacheForThread() |
void |
enableValidation() |
void |
enableWriteBufferForThread() |
<T> void |
ensureCapped(Class<T> c)
automatically convert the collection for the given type to a capped collection
only works if @Capped annotation is given for type
|
<T> void |
ensureCapped(Class<T> c,
AsyncOperationCallback<T> callback) |
void |
ensureIndex(Class<?> cls,
Enum... fldStr) |
void |
ensureIndex(Class<?> cls,
Map<String,Object> index) |
void |
ensureIndex(Class<?> cls,
String... fldStr) |
void |
ensureIndex(Class<?> cls,
String collection,
Map<String,Object> index) |
void |
ensureIndex(Class<?> cls,
String collection,
Map<String,Object> index,
Map<String,Object> options) |
<T> void |
ensureIndex(Class<T> cls,
AsyncOperationCallback<T> callback,
Enum... fldStr)
ensureIndex(CachedObject.class,"counter","-value");
ensureIndex(CachedObject.class,"counter:2d","-value);
Similar to sorting
|
<T> void |
ensureIndex(Class<T> cls,
AsyncOperationCallback<T> callback,
String... fldStr) |
<T> void |
ensureIndex(Class<T> cls,
Map<String,Object> index,
AsyncOperationCallback<T> callback) |
<T> void |
ensureIndex(Class<T> cls,
String collection,
AsyncOperationCallback<T> callback,
Enum... fldStr) |
<T> void |
ensureIndex(Class<T> cls,
String collection,
AsyncOperationCallback<T> callback,
String... fldStr) |
<T> void |
ensureIndex(Class<T> cls,
String collection,
Map<String,Object> index,
AsyncOperationCallback<T> callback) |
<T> void |
ensureIndex(Class<T> cls,
String collection,
Map<String,Object> index,
Map<String,Object> options,
AsyncOperationCallback<T> callback) |
<T> void |
ensureIndicesFor(Class<T> type)
can be called for autmatic index ensurance.
|
<T> void |
ensureIndicesFor(Class<T> type,
AsyncOperationCallback<T> callback) |
<T> void |
ensureIndicesFor(Class<T> type,
String onCollection) |
<T> void |
ensureIndicesFor(Class<T> type,
String onCollection,
AsyncOperationCallback<T> callback) |
<T> void |
ensureIndicesFor(Class<T> type,
String onCollection,
AsyncOperationCallback<T> callback,
MorphiumWriter wr) |
Map<String,Object> |
execCommand(Map<String,Object> command) |
Map<String,Object> |
execCommand(String cmd) |
boolean |
exists(String db) |
boolean |
exists(String db,
String col) |
<T> List<T> |
find(Query<T> q) |
<T> List<T> |
findByField(Class<? extends T> cls,
Enum fld,
Object val) |
<T> List<T> |
findByField(Class<? extends T> cls,
String fld,
Object val) |
<T> T |
findById(Class<? extends T> type,
Object id) |
<T> T |
findById(Class<? extends T> type,
Object id,
String collection) |
<T> void |
findById(Class<? extends T> type,
Object id,
String collection,
AsyncOperationCallback callback) |
<T> List<T> |
findByTemplate(T template,
Enum... fields) |
<T> List<T> |
findByTemplate(T template,
String... fields)
search for objects similar to template concerning all given fields.
|
void |
firePostDropEvent(Class cls) |
<T> void |
firePostLoad(List<T> loaded) |
void |
firePostLoadEvent(Object o)
will be called by query after unmarshalling
|
<T> void |
firePostRemove(List<T> toRemove) |
void |
firePostRemoveEvent(Object o) |
void |
firePostRemoveEvent(Query q) |
<T> void |
firePostStore(Map<T,Boolean> isNew) |
void |
firePostStore(Object o,
boolean isNew) |
void |
firePostUpdateEvent(Class cls,
MorphiumStorageListener.UpdateTypes t) |
void |
firePreDrop(Class cls) |
<T> void |
firePreRemove(List<T> lst) |
void |
firePreRemove(Object o) |
void |
firePreRemoveEvent(Query q) |
void |
firePreStore(Map<Object,Boolean> isNew) |
void |
firePreStore(Object o,
boolean isNew) |
void |
firePreUpdateEvent(Class cls,
MorphiumStorageListener.UpdateTypes t) |
void |
fireProfilingReadEvent(Query q,
long time,
ReadAccessType t) |
void |
fireProfilingWriteEvent(Class type,
Object data,
long time,
boolean isNew,
WriteAccessType wt) |
void |
flush() |
void |
flush(Class type) |
int |
getActiveThreads() |
AnnotationAndReflectionHelper |
getARHelper() |
ThreadPoolExecutor |
getAsyncOperationsThreadPool() |
int |
getAsyncWriterBufferCount() |
int |
getBufferedWriterBufferCount() |
MorphiumCache |
getCache() |
Map<String,Object> |
getCollStats(Class<?> coll) |
Map<String,Object> |
getCollStats(String coll) |
MorphiumConfig |
getConfig() |
ReplicaSetStatus |
getCurrentRSState() |
String |
getDatabase() |
Map<String,Object> |
getDbStats() |
Map<String,Object> |
getDbStats(String db) |
MorphiumDriver |
getDriver() |
EncryptionKeyProvider |
getEncryptionKeyProvider() |
Object |
getId(Object o) |
MorphiumObjectMapper |
getMapper() |
List<Map<String,Object>> |
getMissingIndicesFor(Class<?> entity) |
List<Map<String,Object>> |
getMissingIndicesFor(Class<?> entity,
String collection) |
NameProvider |
getNameProviderForClass(Class<?> cls) |
int |
getNumberOfAvailableThreads() |
ReadPreference |
getReadPreferenceForClass(Class<?> cls) |
List<ShutdownListener> |
getShutDownListeners() |
Map<String,Double> |
getStatistics() |
Map<StatisticKeys,StatisticValue> |
getStats() |
MorphiumTransactionContext |
getTransaction() |
int |
getWriteBufferCount() |
WriteConcern |
getWriteConcernForClass(Class<?> cls) |
int |
getWriterBufferCount() |
MorphiumWriter |
getWriterForClass(Class<?> cls) |
<T> void |
inc(Map<Enum,Number> fieldsToInc,
Query<T> matching,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> callback) |
void |
inc(Object toSet,
Enum field,
double i) |
void |
inc(Object toSet,
Enum field,
int i) |
void |
inc(Object toSet,
Enum field,
long i) |
void |
inc(Object toSet,
Enum field,
Number i) |
void |
inc(Object toSet,
String field,
double i) |
void |
inc(Object toSet,
String field,
int i) |
void |
inc(Object toSet,
String field,
long i) |
void |
inc(Object toSet,
String field,
Number i) |
void |
inc(Query<?> query,
Enum field,
double amount) |
void |
inc(Query<?> query,
Enum field,
double amount,
boolean upsert,
boolean multiple) |
void |
inc(Query<?> query,
Enum field,
int amount) |
void |
inc(Query<?> query,
Enum field,
int amount,
boolean upsert,
boolean multiple) |
void |
inc(Query<?> query,
Enum field,
long amount) |
void |
inc(Query<?> query,
Enum field,
long amount,
boolean upsert,
boolean multiple) |
void |
inc(Query<?> query,
Enum field,
Number amount) |
void |
inc(Query<?> query,
Enum field,
Number amount,
boolean upsert,
boolean multiple) |
void |
inc(Query<?> query,
String field,
double amount) |
void |
inc(Query<?> query,
String name,
double amount,
boolean upsert,
boolean multiple) |
void |
inc(Query<?> query,
String field,
int amount) |
void |
inc(Query<?> query,
String name,
int amount,
boolean upsert,
boolean multiple) |
void |
inc(Query<?> query,
String field,
long amount) |
void |
inc(Query<?> query,
String name,
long amount,
boolean upsert,
boolean multiple) |
void |
inc(Query<?> query,
String field,
Number amount) |
void |
inc(Query<?> query,
String name,
Number amount,
boolean upsert,
boolean multiple) |
<T> void |
inc(Query<T> query,
Enum field,
double amount,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> callback) |
<T> void |
inc(Query<T> query,
Enum field,
int amount,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> callback) |
<T> void |
inc(Query<T> query,
Enum field,
long amount,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> callback) |
<T> void |
inc(Query<T> query,
Enum field,
Number amount,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> callback) |
<T> void |
inc(Query<T> query,
Map<String,Number> toUpdate,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> callback) |
<T> void |
inc(Query<T> query,
String name,
double amount,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> callback) |
<T> void |
inc(Query<T> query,
String name,
int amount,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> callback) |
<T> void |
inc(Query<T> query,
String name,
long amount,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> callback) |
<T> void |
inc(Query<T> query,
String name,
Number amount,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> callback) |
void |
inc(StatisticKeys k) |
<T> void |
inc(T toSet,
Enum field,
double i,
AsyncOperationCallback<T> callback) |
<T> void |
inc(T toSet,
Enum collection,
Enum field,
double i,
AsyncOperationCallback<T> callback) |
<T> void |
inc(T toSet,
Enum field,
int i,
AsyncOperationCallback<T> callback) |
<T> void |
inc(T toSet,
Enum field,
long i,
AsyncOperationCallback<T> callback) |
<T> void |
inc(T toSet,
Enum field,
Number i,
AsyncOperationCallback<T> callback) |
<T> void |
inc(T toSet,
String field,
double i,
AsyncOperationCallback<T> callback) |
<T> void |
inc(T toSet,
String collection,
Enum field,
double i,
AsyncOperationCallback<T> callback) |
<T> void |
inc(T toSet,
String collection,
Enum field,
int i,
AsyncOperationCallback<T> callback) |
<T> void |
inc(T toSet,
String collection,
Enum field,
long i,
AsyncOperationCallback<T> callback) |
<T> void |
inc(T toSet,
String collection,
Enum field,
Number i,
AsyncOperationCallback<T> callback) |
<T> void |
inc(T toSet,
String field,
int i,
AsyncOperationCallback<T> callback) |
<T> void |
inc(T toSet,
String field,
long i,
AsyncOperationCallback<T> callback) |
<T> void |
inc(T toSet,
String field,
Number i,
AsyncOperationCallback<T> callback) |
<T> void |
inc(T toSet,
String collection,
String field,
double i,
AsyncOperationCallback<T> callback) |
<T> void |
inc(T toSet,
String collection,
String field,
int i,
AsyncOperationCallback<T> callback) |
<T> void |
inc(T toSet,
String collection,
String field,
long i,
AsyncOperationCallback<T> callback) |
<T> void |
inc(T toSet,
String collection,
String field,
Number i,
AsyncOperationCallback<T> callback) |
<T> void |
insert(T o) |
<T> void |
insert(T o,
AsyncOperationCallback<T> callback) |
boolean |
isAsyncWritesEnabledForThread() |
boolean |
isAutoValuesEnabledForThread() |
boolean |
isReadCacheEnabledForThread() |
boolean |
isReplicaSet() |
boolean |
isValidationEnabled()
Checks if javax.validation is available and enables validation support.
|
boolean |
isWriteBufferEnabledForThread() |
List<String> |
listCollections() |
List<String> |
listCollections(String pattern) |
List<String> |
listDatabases() |
<T> List<T> |
mapReduce(Class<? extends T> type,
String map,
String reduce) |
void |
pull(Query<?> query,
Enum field,
Object value) |
void |
pull(Query<?> query,
Enum field,
Object value,
boolean upsert,
boolean multiple) |
void |
pull(Query<?> query,
String field,
Object value) |
<T> void |
pull(Query<T> query,
String field,
Expr value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> callback) |
<T> void |
pull(Query<T> query,
String field,
Object value,
boolean upsert,
boolean multiple) |
<T> void |
pull(Query<T> query,
String field,
Object value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> callback)
Asynchronous call to pulll
|
<T> void |
pull(T entity,
String field,
Expr value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> callback) |
void |
pullAll(Query<?> query,
Enum field,
List<Object> value,
boolean upsert,
boolean multiple) |
void |
pullAll(Query<?> query,
String field,
List<Object> value,
boolean upsert,
boolean multiple) |
<T> void |
pullAll(Query<T> query,
String field,
List<?> value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> callback) |
void |
push(Object entity,
Enum field,
Object value,
boolean upsert) |
void |
push(Object entity,
String collection,
Enum field,
Object value,
boolean upsert) |
void |
push(Object entity,
String field,
Object value,
boolean upsert) |
void |
push(Object entity,
String collection,
String field,
Object value,
boolean upsert) |
void |
push(Query<?> query,
Enum field,
Object value) |
void |
push(Query<?> query,
Enum field,
Object value,
boolean upsert,
boolean multiple) |
void |
push(Query<?> query,
String field,
Object value) |
<T> void |
push(Query<T> query,
String field,
Object value,
boolean upsert,
boolean multiple) |
<T> void |
push(Query<T> query,
String field,
Object value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> callback)
asynchronous call to callback
|
void |
pushAll(Query<?> query,
Enum field,
List<Object> value,
boolean upsert,
boolean multiple) |
void |
pushAll(Query<?> query,
String field,
List<?> value,
boolean upsert,
boolean multiple) |
<T> void |
pushAll(Query<T> query,
String field,
List<?> value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> callback) |
<T> void |
pushPull(boolean push,
Query<T> query,
String field,
Object value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> callback) |
<T> void |
pushPullAll(boolean push,
Query<T> query,
String field,
List<?> value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> callback) |
void |
queueTask(Runnable runnable) |
<T> List<T> |
readAll(Class<? extends T> cls)
return a list of all elements stored in morphium for this type
|
void |
reconnectToDb(String db) |
void |
removeClusterListener(com.mongodb.event.ClusterListener cl) |
void |
removeCommandListener(com.mongodb.event.CommandListener cmd) |
void |
removeConnectionPoolListener(com.mongodb.event.ConnectionPoolListener cpl) |
void |
removeListener(MorphiumStorageListener lst) |
void |
removeProfilingListener(ProfilingListener l) |
void |
removeReplicasetStatusListener(ReplicasetStatusListener lst) |
void |
removeShutdownListener(ShutdownListener l) |
<T> T |
reread(T o)
careful this actually changes the parameter o!
|
<T> T |
reread(T o,
String collection) |
void |
reset() |
void |
resetStatistics() |
<T> void |
save(List<T> lst,
AsyncOperationCallback<T> callback) |
<T> void |
save(T o) |
<T> void |
save(T o,
AsyncOperationCallback<T> callback) |
<T> void |
save(T o,
String collection,
AsyncOperationCallback<T> callback) |
<T> void |
saveList(List<T> lst) |
<T> void |
saveList(List<T> lst,
AsyncOperationCallback<T> callback) |
<T> void |
saveList(List<T> lst,
String collection) |
<T> void |
saveList(List<T> lst,
String collection,
AsyncOperationCallback<T> callback) |
<T> void |
saveList(Set<T> set) |
Map<String,Integer> |
saveMap(String collection,
Map<String,Object> m) |
Map<String,Integer> |
saveMaps(Class type,
List<Map<String,Object>> lst) |
Map<String,Integer> |
saveMaps(String collection,
List<Map<String,Object>> lst) |
<T> void |
set(Map<String,Object> values,
T into) |
void |
set(Query<?> query,
Map<String,Object> map,
boolean upsert,
boolean multiple) |
<T> void |
set(Query<T> query,
Enum field,
Object val) |
<T> void |
set(Query<T> query,
Enum field,
Object val,
AsyncOperationCallback<T> callback) |
<T> void |
set(Query<T> query,
Enum field,
Object val,
boolean upsert,
boolean multiple)
will change an entry in mongodb-collection corresponding to given class object
if query is too complex, upsert might not work!
|
<T> void |
set(Query<T> query,
Enum field,
Object val,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> callback) |
<T> void |
set(Query<T> query,
Map<String,Object> map,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> callback) |
<T> void |
set(Query<T> query,
String field,
Object val) |
<T> void |
set(Query<T> query,
String field,
Object val,
AsyncOperationCallback<T> callback) |
<T> void |
set(Query<T> query,
String field,
Object val,
boolean upsert,
boolean multiple) |
<T> void |
set(Query<T> query,
String field,
Object val,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> callback) |
<T> void |
set(String inCollection,
Map<Enum,Object> values,
T into) |
<T> void |
set(T toSet,
Enum field,
Object value) |
<T> void |
set(T toSet,
Enum field,
Object value,
AsyncOperationCallback<T> callback) |
<T> void |
set(T toSet,
Enum field,
Object value,
boolean upserts,
AsyncOperationCallback<T> callback) |
<T> void |
set(T toSet,
Map<Enum,Object> values) |
<T> void |
set(T toSet,
String collection,
boolean upserts,
Map<Enum,Object> values) |
<T> void |
set(T toSet,
String collection,
boolean upserts,
Map<Enum,Object> values,
AsyncOperationCallback<T> callback) |
<T> void |
set(T toSet,
String collection,
Enum field,
Object value) |
<T> void |
set(T toSet,
String collection,
Enum field,
Object value,
boolean upserts,
AsyncOperationCallback<T> callback) |
<T> void |
set(T toSet,
String collection,
Map<String,Object> values) |
<T> void |
set(T toSet,
String collection,
Map<String,Object> values,
boolean upserts) |
<T> void |
set(T toSet,
String collection,
Map<String,Object> values,
boolean upserts,
AsyncOperationCallback<T> callback) |
<T> void |
set(T toSet,
String field,
Object value)
setting a value in an existing mongo collection entry - no reading necessary.
|
<T> void |
set(T toSet,
String field,
Object value,
AsyncOperationCallback<T> callback) |
<T> void |
set(T toSet,
String field,
Object value,
boolean upserts,
AsyncOperationCallback<T> callback) |
<T> void |
set(T toSet,
String collection,
String field,
Object value,
boolean upserts,
AsyncOperationCallback<T> callback) |
<T> boolean |
setAutoValues(T o) |
void |
setConfig(MorphiumConfig cfg) |
void |
setDriver(MorphiumDriver drv) |
void |
setEnum(Query<?> query,
Map<Enum,Object> values,
boolean upsert,
boolean multiple) |
void |
setNameProviderForClass(Class<?> cls,
NameProvider pro) |
void |
setTransaction(MorphiumTransactionContext ctx) |
Map<String,Object> |
simplifyQueryObject(Map<String,Object> q) |
void |
startTransaction() |
<T> void |
store(List<T> lst,
AsyncOperationCallback<T> callback) |
<T> void |
store(List<T> lst,
String collectionName,
AsyncOperationCallback<T> callback) |
<T> void |
store(T o)
Stores a single Object.
|
<T> void |
store(T o,
AsyncOperationCallback<T> callback) |
<T> void |
store(T o,
String collection,
AsyncOperationCallback<T> callback) |
<T> void |
storeBuffered(T lst) |
<T> void |
storeBuffered(T lst,
AsyncOperationCallback<T> callback) |
<T> void |
storeBuffered(T lst,
String collection,
AsyncOperationCallback<T> callback) |
<T> void |
storeList(List<T> lst)
sorts elements in this list, whether to store in background or directly.
|
<T> void |
storeList(List<T> lst,
AsyncOperationCallback<T> callback) |
<T> void |
storeList(List<T> lst,
String collection)
stores all elements of this list to the given collection
|
<T> void |
storeList(List<T> lst,
String collection,
AsyncOperationCallback<T> callback) |
<T> void |
storeList(Set<T> set) |
Map<String,Integer> |
storeMap(Class type,
Map<String,Object> m)
directly writes data to Mongo, no Mapper used
use with caution, as caches are not updated
also no checks for validity of fields, no references, no auto-variables
no async writing!
|
Map<String,Integer> |
storeMap(String collection,
Map<String,Object> m)
directly writes data to Mongo, no Mapper used
use with caution, as caches are not updated
also no checks for validity of fields, no references, no auto-variables
no async writing!
|
Map<String,Integer> |
storeMaps(Class type,
List<Map<String,Object>> lst)
directly writes data to Mongo, no Mapper used
use with caution, as caches are not updated
also no checks for validity of fields, no references, no auto-variables
no async writing!
|
Map<String,Integer> |
storeMaps(String collection,
List<Map<String,Object>> lst)
directly writes data to Mongo, no Mapper used
use with caution, as caches are not updated
also no checks for validity of fields, no references, no auto-variables
no async writing!
|
<T> void |
storeNoCache(T lst) |
<T> void |
storeNoCache(T o,
AsyncOperationCallback<T> callback) |
<T> void |
storeNoCache(T o,
String collection) |
<T> void |
storeNoCache(T o,
String collection,
AsyncOperationCallback<T> callback) |
<T> void |
unset(T toSet,
Enum field) |
<T> void |
unset(T toSet,
Enum field,
AsyncOperationCallback<T> callback) |
<T> void |
unset(T toSet,
String field) |
<T> void |
unset(T toSet,
String field,
AsyncOperationCallback<T> callback) |
<T> void |
unset(T toSet,
String collection,
Enum field) |
<T> void |
unset(T toSet,
String collection,
Enum field,
AsyncOperationCallback<T> callback) |
<T> void |
unset(T toSet,
String collection,
String field,
AsyncOperationCallback<T> callback) |
<T> void |
unsetQ(Query<T> q,
AsyncOperationCallback<T> cb,
boolean multiple,
String... field) |
<T> void |
unsetQ(Query<T> q,
AsyncOperationCallback<T> cb,
Enum... field) |
<T> void |
unsetQ(Query<T> q,
AsyncOperationCallback<T> cb,
String... field) |
<T> void |
unsetQ(Query<T> q,
boolean multiple,
AsyncOperationCallback<T> cb,
Enum... field) |
<T> void |
unsetQ(Query<T> q,
boolean multiple,
Enum... field) |
<T> void |
unsetQ(Query<T> q,
boolean multiple,
String... field) |
<T> void |
unsetQ(Query<T> q,
Enum... field) |
<T> void |
unsetQ(Query<T> q,
String... field) |
void |
updateUsingFields(Object ent,
Enum... fieldNames) |
void |
updateUsingFields(Object ent,
String... fields)
updating an enty in DB without sending the whole entity
only transfers the fields to be changed / set
|
<T> void |
updateUsingFields(T ent,
AsyncOperationCallback<T> callback,
Enum... fields) |
<T> void |
updateUsingFields(T ent,
AsyncOperationCallback<T> callback,
String... fields) |
<T> void |
updateUsingFields(T ent,
String collection,
AsyncOperationCallback<T> callback,
Enum... fields) |
<T> void |
updateUsingFields(T ent,
String collection,
AsyncOperationCallback<T> callback,
String... fields) |
<T> void |
watch(Class<T> entity,
boolean updateFull,
ChangeStreamListener lst) |
<T> void |
watch(Class<T> entity,
boolean updateFull,
List<Map<String,Object>> pipeline,
ChangeStreamListener lst) |
<T> void |
watch(String collectionName,
boolean updateFull,
ChangeStreamListener lst) |
<T> void |
watch(String collectionName,
boolean updateFull,
List<Map<String,Object>> pipeline,
ChangeStreamListener lst) |
<T> void |
watch(String collectionName,
int maxWaitTime,
boolean updateFull,
List<Map<String,Object>> pipeline,
ChangeStreamListener lst) |
<T> void |
watchAsync(Class<T> entity,
boolean updateFull,
ChangeStreamListener lst) |
<T> void |
watchAsync(Class<T> entity,
boolean updateFull,
List<Map<String,Object>> pipeline,
ChangeStreamListener lst) |
<T> void |
watchAsync(String collectionName,
boolean updateFull,
ChangeStreamListener lst) |
<T> void |
watchAsync(String collectionName,
boolean updateFull,
List<Map<String,Object>> pipeline,
ChangeStreamListener lst) |
<T> void |
watchDb(boolean updateFull,
ChangeStreamListener lst) |
<T> void |
watchDb(String dbName,
boolean updateFull,
ChangeStreamListener lst) |
<T> void |
watchDb(String dbName,
boolean updateFull,
List<Map<String,Object>> pipeline,
ChangeStreamListener lst) |
<T> void |
watchDb(String dbName,
int maxWaitTime,
boolean updateFull,
List<Map<String,Object>> pipeline,
ChangeStreamListener lst) |
<T> void |
watchDbAsync(boolean updateFull,
ChangeStreamListener lst) |
<T> void |
watchDbAsync(boolean updateFull,
List<Map<String,Object>> pipeline,
ChangeStreamListener lst) |
<T> void |
watchDbAsync(String dbName,
boolean updateFull,
List<Map<String,Object>> pipeline,
ChangeStreamListener lst) |
int |
writeBufferCount() |
public Morphium()
public Morphium(MorphiumConfig cfg)
MorphiumConfigpublic MorphiumConfig getConfig()
public void setConfig(MorphiumConfig cfg)
public ThreadPoolExecutor getAsyncOperationsThreadPool()
public EncryptionKeyProvider getEncryptionKeyProvider()
public MorphiumCache getCache()
public boolean isValidationEnabled()
public void disableValidation()
public void enableValidation()
public void reconnectToDb(String db)
public void addListener(MorphiumStorageListener lst)
public void removeListener(MorphiumStorageListener lst)
public MorphiumDriver getDriver()
public void setDriver(MorphiumDriver drv)
public <T> List<T> findByTemplate(T template, String... fields)
T - - typetemplate - - what to search forfields - - fields to use for searchingpublic <T> void unset(T toSet,
Enum field)
public <T> void unset(T toSet,
String field)
public <T> void unset(T toSet,
Enum field,
AsyncOperationCallback<T> callback)
public <T> void unset(T toSet,
String collection,
Enum field,
AsyncOperationCallback<T> callback)
public <T> void unset(T toSet,
String field,
AsyncOperationCallback<T> callback)
public <T> void unset(T toSet,
String collection,
String field,
AsyncOperationCallback<T> callback)
public <T> void unsetQ(Query<T> q, AsyncOperationCallback<T> cb, String... field)
public <T> void unsetQ(Query<T> q, AsyncOperationCallback<T> cb, boolean multiple, String... field)
public <T> void unsetQ(Query<T> q, AsyncOperationCallback<T> cb, Enum... field)
public <T> void unsetQ(Query<T> q, boolean multiple, AsyncOperationCallback<T> cb, Enum... field)
public <T> void ensureIndicesFor(Class<T> type)
type - type to ensure indices forpublic <T> void ensureIndicesFor(Class<T> type, AsyncOperationCallback<T> callback)
public <T> void ensureIndicesFor(Class<T> type, String onCollection, AsyncOperationCallback<T> callback)
public void addReplicasetStatusListener(ReplicasetStatusListener lst)
public void removeReplicasetStatusListener(ReplicasetStatusListener lst)
public <T> void ensureIndicesFor(Class<T> type, String onCollection, AsyncOperationCallback<T> callback, MorphiumWriter wr)
public <T> void convertToCapped(Class<T> c, int size, AsyncOperationCallback<T> cb)
T - typec - entity typesize - size of capped collectioncb - callbackpublic <T> void convertToCapped(String coll, int size, AsyncOperationCallback<T> cb)
public <T> void ensureCapped(Class<T> c)
c - - typepublic <T> void ensureCapped(Class<T> c, AsyncOperationCallback<T> callback)
public <T> void set(Query<T> query, Enum field, Object val, AsyncOperationCallback<T> callback)
public <T> void set(Query<T> query, String field, Object val, AsyncOperationCallback<T> callback)
public void setEnum(Query<?> query, Map<Enum,Object> values, boolean upsert, boolean multiple)
public void pushAll(Query<?> query, Enum field, List<Object> value, boolean upsert, boolean multiple)
public void pullAll(Query<?> query, Enum field, List<Object> value, boolean upsert, boolean multiple)
public <T> void push(Query<T> query, String field, Object value, boolean upsert, boolean multiple)
public <T> void push(Query<T> query, String field, Object value, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback)
T - - the typequery - - the queryfield - - field to push values tovalue - - value to pushupsert - - insert object, if it does not existmultiple - - more than onecallback - - will be called, when operation succeeds - synchronous call, if nullpublic <T> void pull(Query<T> query, String field, Object value, boolean upsert, boolean multiple)
public <T> void pull(Query<T> query, String field, Object value, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback)
T - - typequery - - queryfield - - field to pullvalue - - value to pull from fieldupsert - - insert document unless it existsmultiple - - more than onecallback - -callback to call when operation succeeds - synchronous call, if nullpublic <T> void pull(T entity,
String field,
Expr value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> callback)
public <T> void pull(Query<T> query, String field, Expr value, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback)
public void pushAll(Query<?> query, String field, List<?> value, boolean upsert, boolean multiple)
public <T> void pushAll(Query<T> query, String field, List<?> value, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback)
public <T> void set(Query<T> query, Enum field, Object val, boolean upsert, boolean multiple)
query - - query to specify which objects should be setfield - - field to setval - - value to setupsert - - insert, if it does not exist (query needs to be simple!)multiple - - update several documents, if false, only first hit will be updatedpublic <T> void set(Query<T> query, Enum field, Object val, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback)
public void pullAll(Query<?> query, String field, List<Object> value, boolean upsert, boolean multiple)
public <T> void set(Query<T> query, String field, Object val, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback)
public <T> void set(Query<T> query, Map<String,Object> map, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback)
public <T> void currentDate(Query<?> query, String field, boolean upsert, boolean multiple)
T - query - field - upsert - multiple - public <T> void currentDate(Query<?> query, Enum field, boolean upsert, boolean multiple)
public <T> void set(T toSet,
Enum field,
Object value,
AsyncOperationCallback<T> callback)
public <T> void set(T toSet,
Enum field,
Object value,
boolean upserts,
AsyncOperationCallback<T> callback)
public <T> void set(T toSet,
String collection,
boolean upserts,
Map<Enum,Object> values,
AsyncOperationCallback<T> callback)
public <T> void set(T toSet,
String field,
Object value)
toSet - - object to set the value in (or better - the corresponding entry in mongo)field - - the field to changevalue - - the value to setpublic <T> void set(T toSet,
String field,
Object value,
boolean upserts,
AsyncOperationCallback<T> callback)
public <T> void set(T toSet,
String collection,
Map<String,Object> values,
boolean upserts,
AsyncOperationCallback<T> callback)
public Map<String,Object> getDbStats(String db) throws MorphiumDriverException
MorphiumDriverExceptionpublic Map<String,Object> getDbStats() throws MorphiumDriverException
MorphiumDriverExceptionpublic Map<String,Object> getCollStats(Class<?> coll) throws MorphiumDriverException
MorphiumDriverExceptionpublic Map<String,Object> getCollStats(String coll) throws MorphiumDriverException
MorphiumDriverExceptionpublic <T> void set(T toSet,
String collection,
Enum field,
Object value,
boolean upserts,
AsyncOperationCallback<T> callback)
public <T> void set(T toSet,
String collection,
String field,
Object value,
boolean upserts,
AsyncOperationCallback<T> callback)
public <T> void set(T toSet,
String field,
Object value,
AsyncOperationCallback<T> callback)
public <T> void inc(Map<Enum,Number> fieldsToInc, Query<T> matching, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback)
public <T> void inc(Query<T> query, Map<String,Number> toUpdate, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback)
public <T> void dec(Map<Enum,Number> fieldsToInc, Query<T> matching, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback)
public <T> void dec(Query<T> query, Map<String,Number> toUpdate, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback)
public <T> void inc(Query<T> query, Enum field, long amount, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback)
public <T> void inc(Query<T> query, String name, long amount, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback)
public <T> void inc(Query<T> query, Enum field, int amount, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback)
public <T> void inc(Query<T> query, String name, int amount, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback)
public <T> void inc(Query<T> query, Enum field, double amount, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback)
public <T> void inc(Query<T> query, String name, double amount, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback)
public <T> void inc(Query<T> query, Enum field, Number amount, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback)
public <T> void inc(Query<T> query, String name, Number amount, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback)
public <T> void dec(Query<T> query, Enum field, long amount, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback)
public <T> void dec(Query<T> query, String name, long amount, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback)
public <T> void dec(Query<T> query, Enum field, int amount, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback)
public <T> void dec(Query<T> query, String name, int amount, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback)
public <T> void dec(Query<T> query, Enum field, double amount, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback)
public <T> void dec(Query<T> query, String name, double amount, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback)
public <T> void dec(Query<T> query, Enum field, Number amount, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback)
public <T> void dec(Query<T> query, String name, Number amount, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback)
public MorphiumWriter getWriterForClass(Class<?> cls)
public void dec(Object toDec, Enum field, double amount)
inc(toDec,field,-amount);public <T> void inc(T toSet,
Enum field,
double i,
AsyncOperationCallback<T> callback)
public <T> void inc(T toSet,
String field,
double i,
AsyncOperationCallback<T> callback)
public <T> void inc(T toSet,
Enum field,
int i,
AsyncOperationCallback<T> callback)
public <T> void inc(T toSet,
String field,
int i,
AsyncOperationCallback<T> callback)
public <T> void inc(T toSet,
Enum field,
long i,
AsyncOperationCallback<T> callback)
public <T> void inc(T toSet,
String field,
long i,
AsyncOperationCallback<T> callback)
public <T> void inc(T toSet,
Enum field,
Number i,
AsyncOperationCallback<T> callback)
public <T> void inc(T toSet,
String field,
Number i,
AsyncOperationCallback<T> callback)
public <T> void inc(T toSet,
Enum collection,
Enum field,
double i,
AsyncOperationCallback<T> callback)
public <T> void inc(T toSet,
String collection,
Enum field,
double i,
AsyncOperationCallback<T> callback)
public <T> void inc(T toSet,
String collection,
String field,
double i,
AsyncOperationCallback<T> callback)
public <T> void inc(T toSet,
String collection,
Enum field,
int i,
AsyncOperationCallback<T> callback)
public <T> void inc(T toSet,
String collection,
String field,
int i,
AsyncOperationCallback<T> callback)
public <T> void inc(T toSet,
String collection,
Enum field,
long i,
AsyncOperationCallback<T> callback)
public <T> void inc(T toSet,
String collection,
String field,
long i,
AsyncOperationCallback<T> callback)
public <T> void inc(T toSet,
String collection,
Enum field,
Number i,
AsyncOperationCallback<T> callback)
public <T> void inc(T toSet,
String collection,
String field,
Number i,
AsyncOperationCallback<T> callback)
public <T> void delete(List<T> lst, String forceCollectionName, AsyncOperationCallback<T> callback)
public <T> void delete(List<T> lst, AsyncOperationCallback<T> callback)
public void inc(StatisticKeys k)
public void updateUsingFields(Object ent, String... fields)
ent - - entity to updatefields - - fields to usepublic <T> void updateUsingFields(T ent,
AsyncOperationCallback<T> callback,
Enum... fields)
public <T> void updateUsingFields(T ent,
AsyncOperationCallback<T> callback,
String... fields)
public <T> void updateUsingFields(T ent,
String collection,
AsyncOperationCallback<T> callback,
Enum... fields)
public <T> void updateUsingFields(T ent,
String collection,
AsyncOperationCallback<T> callback,
String... fields)
public MorphiumObjectMapper getMapper()
public AnnotationAndReflectionHelper getARHelper()
public <T> T reread(T o)
T - - tpye of the objecto - - object to readpublic <T> T reread(T o,
String collection)
public void firePreStore(Object o, boolean isNew)
public void firePostStore(Object o, boolean isNew)
public void firePreDrop(Class cls)
public <T> void firePostRemove(List<T> toRemove)
public <T> void firePostLoad(List<T> loaded)
public <T> void firePreRemove(List<T> lst)
public void firePreRemove(Object o)
public void firePostDropEvent(Class cls)
public void firePostUpdateEvent(Class cls, MorphiumStorageListener.UpdateTypes t)
public void firePreUpdateEvent(Class cls, MorphiumStorageListener.UpdateTypes t)
public void firePostRemoveEvent(Object o)
public void firePostRemoveEvent(Query q)
public void firePreRemoveEvent(Query q)
public <T> T deReference(T obj)
T - - typeobj - - the object to replactpublic void setNameProviderForClass(Class<?> cls, NameProvider pro)
public NameProvider getNameProviderForClass(Class<?> cls)
public void firePostLoadEvent(Object o)
o - - entitiypublic ReplicaSetStatus getCurrentRSState()
public boolean isReplicaSet()
public ReadPreference getReadPreferenceForClass(Class<?> cls)
public MorphiumBulkContext createBulkRequestContext(Class<?> type, boolean ordered)
public MorphiumBulkContext createBulkRequestContext(String collection, boolean ordered)
public WriteConcern getWriteConcernForClass(Class<?> cls)
public void addProfilingListener(ProfilingListener l)
public void removeProfilingListener(ProfilingListener l)
public void fireProfilingWriteEvent(Class type, Object data, long time, boolean isNew, WriteAccessType wt)
public void fireProfilingReadEvent(Query q, long time, ReadAccessType t)
public void clearCollection(Class<?> cls)
cls - - classpublic void clearCollection(Class<?> cls, String colName)
cls - - classcolName - - CollectionNamepublic void clearCollectionOneByOne(Class<?> cls)
cls - -classpublic <T> List<T> readAll(Class<? extends T> cls)
T - - Typecls - - type to search for, needs to be an Propertypublic <T> Query<T> createQueryFor(Class<? extends T> type, String usingCollectionName)
public List<Object> distinct(Enum key, Query q)
public List<Object> distinct(String key, Query q)
public <T> void findById(Class<? extends T> type, Object id, String collection, AsyncOperationCallback callback)
public <T> boolean setAutoValues(T o)
throws IllegalAccessException
IllegalAccessExceptionpublic void clearCachefor(Class<?> cls)
cls - - classpublic void clearCacheforClassIfNecessary(Class<?> cls)
public <T> void storeNoCache(T lst)
public <T> void storeNoCache(T o,
AsyncOperationCallback<T> callback)
public <T> void storeNoCache(T o,
String collection)
public <T> void storeNoCache(T o,
String collection,
AsyncOperationCallback<T> callback)
public <T> void storeBuffered(T lst)
public <T> void storeBuffered(T lst,
AsyncOperationCallback<T> callback)
public <T> void storeBuffered(T lst,
String collection,
AsyncOperationCallback<T> callback)
public void flush()
public void flush(Class type)
public <T> void dropCollection(Class<T> cls, AsyncOperationCallback<T> callback)
public <T> void dropCollection(Class<T> cls, String collection, AsyncOperationCallback<T> callback)
public void dropCollection(Class<?> cls)
public <T> void ensureIndex(Class<T> cls, Map<String,Object> index, AsyncOperationCallback<T> callback)
public <T> void ensureIndex(Class<T> cls, String collection, Map<String,Object> index, Map<String,Object> options, AsyncOperationCallback<T> callback)
public <T> void ensureIndex(Class<T> cls, String collection, Map<String,Object> index, AsyncOperationCallback<T> callback)
public int writeBufferCount()
public <T> void store(List<T> lst, String collectionName, AsyncOperationCallback<T> callback)
public void ensureIndex(Class<?> cls, String collection, Map<String,Object> index, Map<String,Object> options)
public <T> void ensureIndex(Class<T> cls, AsyncOperationCallback<T> callback, Enum... fldStr)
cls - - classfldStr - - fieldspublic <T> void ensureIndex(Class<T> cls, String collection, AsyncOperationCallback<T> callback, Enum... fldStr)
public <T> void ensureIndex(Class<T> cls, AsyncOperationCallback<T> callback, String... fldStr)
public <T> void ensureIndex(Class<T> cls, String collection, AsyncOperationCallback<T> callback, String... fldStr)
public String getDatabase()
public <T> void insert(T o)
public <T> void insert(T o,
AsyncOperationCallback<T> callback)
public Map<String,Integer> storeMaps(Class type, List<Map<String,Object>> lst) throws MorphiumDriverException
type - - type to write to (just for determining collection name)lst - - list of entries to writeMorphiumDriverExceptionpublic Map<String,Integer> saveMaps(Class type, List<Map<String,Object>> lst) throws MorphiumDriverException
MorphiumDriverExceptionpublic Map<String,Integer> storeMaps(String collection, List<Map<String,Object>> lst) throws MorphiumDriverException
collection - - name of colleciton to write tolst - - list of entries to writeMorphiumDriverExceptionpublic Map<String,Integer> saveMaps(String collection, List<Map<String,Object>> lst) throws MorphiumDriverException
MorphiumDriverExceptionpublic Map<String,Integer> storeMap(String collection, Map<String,Object> m) throws MorphiumDriverException
collection - collection namem - data to writeMorphiumDriverExceptionpublic Map<String,Integer> saveMap(String collection, Map<String,Object> m) throws MorphiumDriverException
MorphiumDriverExceptionpublic Map<String,Integer> storeMap(Class type, Map<String,Object> m) throws MorphiumDriverException
type - - type, used to determine collection namem - - data to writeMorphiumDriverExceptionpublic <T> void store(T o)
o - - Object to storepublic <T> void save(T o)
public <T> void store(T o,
AsyncOperationCallback<T> callback)
public <T> void save(T o,
AsyncOperationCallback<T> callback)
public <T> void store(T o,
String collection,
AsyncOperationCallback<T> callback)
public <T> void save(T o,
String collection,
AsyncOperationCallback<T> callback)
public <T> void save(List<T> lst, AsyncOperationCallback<T> callback)
public <T> void store(List<T> lst, AsyncOperationCallback<T> callback)
public <T> void storeList(List<T> lst, String collection)
T - - type of entitylst - - list of objects to storecollection - - collection name to usepublic <T> void storeList(List<T> lst, String collection, AsyncOperationCallback<T> callback)
public <T> void saveList(List<T> lst, String collection, AsyncOperationCallback<T> callback)
public <T> void storeList(List<T> lst)
T - - type of list elementslst - - all objects are sorted whether to store in BG or direclty. All objects are stored in their corresponding collectionpublic <T> void saveList(List<T> lst)
public <T> void storeList(Set<T> set)
public <T> void saveList(Set<T> set)
public <T> void storeList(List<T> lst, AsyncOperationCallback<T> callback)
public <T> void saveList(List<T> lst, AsyncOperationCallback<T> callback)
public <T> void delete(Query<T> o)
public <T> void delete(Query<T> o, AsyncOperationCallback<T> callback)
public <T> void pushPull(boolean push,
Query<T> query,
String field,
Object value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> callback)
public <T> void pushPullAll(boolean push,
Query<T> query,
String field,
List<?> value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> callback)
public <T> void pullAll(Query<T> query, String field, List<?> value, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback)
public void delete(Object o)
o - - entitypublic <T> void delete(T lo,
AsyncOperationCallback<T> callback)
public <T> void delete(T lo,
String collection,
AsyncOperationCallback<T> callback)
public boolean exists(String db) throws MorphiumDriverException
MorphiumDriverExceptionpublic boolean exists(String db, String col) throws MorphiumDriverException
MorphiumDriverExceptionpublic void resetStatistics()
public Map<StatisticKeys,StatisticValue> getStats()
public List<ShutdownListener> getShutDownListeners()
public void addShutdownListener(ShutdownListener l)
public void removeShutdownListener(ShutdownListener l)
public void close()
close in interface AutoCloseablepublic <T> List<T> mapReduce(Class<? extends T> type, String map, String reduce) throws MorphiumDriverException
MorphiumDriverExceptionpublic <T,R> Aggregator<T,R> createAggregator(Class<? extends T> type, Class<? extends R> resultType)
public <T> T createLazyLoadedEntity(Class<? extends T> cls, Object id, String collectionName)
public <T> MongoField<T> createMongoField()
public int getWriteBufferCount()
public int getBufferedWriterBufferCount()
public int getAsyncWriterBufferCount()
public int getWriterBufferCount()
public void disableAutoValuesForThread()
public void enableAutoValuesForThread()
public boolean isAutoValuesEnabledForThread()
public void disableReadCacheForThread()
public void enableReadCacheForThread()
public boolean isReadCacheEnabledForThread()
public void disableWriteBufferForThread()
public void enableWriteBufferForThread()
public boolean isWriteBufferEnabledForThread()
public void disableAsyncWritesForThread()
public void enableAsyncWritesForThread()
public boolean isAsyncWritesEnabledForThread()
public void queueTask(Runnable runnable)
public int getNumberOfAvailableThreads()
public int getActiveThreads()
public void startTransaction()
public MorphiumTransactionContext getTransaction()
public void setTransaction(MorphiumTransactionContext ctx)
public void commitTransaction()
public void abortTransaction()
public <T> void watchAsync(String collectionName, boolean updateFull, ChangeStreamListener lst)
public <T> void watchAsync(String collectionName, boolean updateFull, List<Map<String,Object>> pipeline, ChangeStreamListener lst)
public <T> void watchAsync(Class<T> entity, boolean updateFull, ChangeStreamListener lst)
public <T> void watchAsync(Class<T> entity, boolean updateFull, List<Map<String,Object>> pipeline, ChangeStreamListener lst)
public <T> void watch(Class<T> entity, boolean updateFull, ChangeStreamListener lst)
public <T> void watch(Class<T> entity, boolean updateFull, List<Map<String,Object>> pipeline, ChangeStreamListener lst)
public <T> void watch(String collectionName, boolean updateFull, ChangeStreamListener lst)
public <T> void watch(String collectionName, boolean updateFull, List<Map<String,Object>> pipeline, ChangeStreamListener lst)
public <T> void watch(String collectionName, int maxWaitTime, boolean updateFull, List<Map<String,Object>> pipeline, ChangeStreamListener lst)
public <T> void watchDbAsync(String dbName, boolean updateFull, List<Map<String,Object>> pipeline, ChangeStreamListener lst)
public <T> void watchDbAsync(boolean updateFull,
ChangeStreamListener lst)
public <T> void watchDbAsync(boolean updateFull,
List<Map<String,Object>> pipeline,
ChangeStreamListener lst)
public <T> void watchDb(boolean updateFull,
ChangeStreamListener lst)
public <T> void watchDb(String dbName, boolean updateFull, ChangeStreamListener lst)
public <T> void watchDb(String dbName, boolean updateFull, List<Map<String,Object>> pipeline, ChangeStreamListener lst)
public <T> void watchDb(String dbName, int maxWaitTime, boolean updateFull, List<Map<String,Object>> pipeline, ChangeStreamListener lst)
public void reset()
public List<Map<String,Object>> getMissingIndicesFor(Class<?> entity) throws MorphiumDriverException
MorphiumDriverExceptionpublic List<Map<String,Object>> getMissingIndicesFor(Class<?> entity, String collection) throws MorphiumDriverException
MorphiumDriverExceptionpublic Map<Class<?>,List<Map<String,Object>>> checkIndices()
public Map<Class<?>,List<Map<String,Object>>> checkIndices(io.github.classgraph.ClassInfoList.ClassInfoFilter filter)
public void addCommandListener(com.mongodb.event.CommandListener cmd)
public void removeCommandListener(com.mongodb.event.CommandListener cmd)
public void addClusterListener(com.mongodb.event.ClusterListener cl)
public void removeClusterListener(com.mongodb.event.ClusterListener cl)
public void addConnectionPoolListener(com.mongodb.event.ConnectionPoolListener cpl)
public void removeConnectionPoolListener(com.mongodb.event.ConnectionPoolListener cpl)
Copyright © 2022. All rights reserved.