Package de.caluga.morphium
Klasse Morphium
java.lang.Object
de.caluga.morphium.Morphium
- Alle implementierten Schnittstellen:
AutoCloseable
This is the single access point for accessing MongoDB. This should
- Autor:
- stephan
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidaddAllToSet(Query<T> query, String field, List<?> value, boolean multiple) addAllToSet(Query<T> query, String field, List<?> value, boolean upsert, boolean multiple) addAllToSet(Query<T> query, String field, List<?> value, boolean upsert, boolean multiple, AsyncOperationCallback callback) voidaddListener(MorphiumStorageListener<?> lst) voidvoidaddToSet(Query<T> query, String field, Object value, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) Map<Class<?>,List<IndexDescription>> run trhough classpath, find all Entities, check indices returns a list of Entities, whos indices are missing or differentMap<Class<?>,List<IndexDescription>> checkIndices(io.github.classgraph.ClassInfoList.ClassInfoFilter filter) voidclearCachefor(Class<?> cls) Erase cache entries for the given type. is being called after every store depending on cache settings!voidclearCacheforClassIfNecessary(Class<?> cls) voidclearCollection(Class<?> cls) issues a remove command - no lifecycle methods calles, no drop, keeps all indexec this wayvoidclearCollection(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 classvoidclearCollectionOneByOne(Class<?> cls) clears every single object in collection - reads ALL objects to do so this way Lifecycle methods can be called!voidclose()void<T,R> Aggregator<T, R> createAggregator(Class<? extends T> type, Class<? extends R> resultType) createBulkRequestContext(Class<?> type, boolean ordered) createBulkRequestContext(String collection, boolean ordered) <T> voidcreateIndex(Class<T> cls, String collection, IndexDescription index, AsyncOperationCallback<T> callback) createIndexKeyMapFrom(String[] fldStr) <T> TcreateLazyLoadedEntity(Class<? extends T> cls, Object id, String collectionName) createMapQuery(String collection) <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) currentDate(Query<?> query, Enum field, boolean upsert, boolean multiple) currentDate(Query<?> query, String field, boolean upsert, boolean multiple) set current date into one fielddec(Query<T> query, Enum<?> field, double amount, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) dec(Query<T> query, Enum<?> field, int amount, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) dec(Query<T> query, Enum<?> field, long amount, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) dec(Query<T> query, Enum<?> field, Number amount, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) dec(Query<T> query, String name, double amount, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) dec(Query<T> query, String name, int amount, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) dec(Query<T> query, String name, long amount, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) dec(Query<T> query, String name, Number amount, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) dec(Query<T> query, Map<String, Number> toUpdate, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) voiddecreasing a value of a given object callesinc(toDec,field,-amount);voidvoidvoidvoidvoidvoidvoid<T> voiddec(Map<Enum, Number> fieldsToInc, Query<T> matching, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) <T> void<T> voiddelete(Query<T> o, AsyncOperationCallback<T> callback) voiddeletes a single object from morphium backend.void<T> voiddelete(List<T> lst, AsyncOperationCallback<T> callback) <T> void<T> voiddelete(List<T> lst, String forceCollectionName, AsyncOperationCallback<T> callback) <T> voiddelete(T lo, AsyncOperationCallback<T> callback) <T> voiddelete(T lo, String collection, AsyncOperationCallback<T> callback) <T> TdeReference(T obj) de-references the given object of type T.voidvoidvoidvoidvoidreturns a distinct list of values of the given collection Attention: these values are not unmarshalled, you might get MongoMapUngültige Eingabe: "<"String,Object>sreturns a distinct list of values of the given collection Attention: these values are not unmarshalled, you might get MongoMapUngültige Eingabe: "<"String,Object>svoiddropCollection(Class<?> cls) <T> voiddropCollection(Class<T> cls, AsyncOperationCallback<T> callback) <T> voiddropCollection(Class<T> cls, String collection, AsyncOperationCallback<T> callback) voidvoidvoidvoidvoid<T> voidensureCapped(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> voidensureCapped(Class<T> c, AsyncOperationCallback<T> callback) voidensureIndex(Class<?> cls, Enum... fldStr) voidensureIndex(Class<?> cls, String... fldStr) voidVeraltet.voidVeraltet.voidensureIndex(Class<?> cls, Map<String, Object> index) Veraltet.<T> voidensureIndex(Class<T> cls, AsyncOperationCallback<T> callback, Enum... fldStr) Veraltet.<T> voidensureIndex(Class<T> cls, AsyncOperationCallback<T> callback, String... fldStr) Veraltet.<T> voidensureIndex(Class<T> cls, String collection, AsyncOperationCallback<T> callback, Enum... fldStr) Veraltet.<T> voidensureIndex(Class<T> cls, String collection, AsyncOperationCallback<T> callback, String... fldStr) Veraltet.<T> voidensureIndex(Class<T> cls, String collection, Map<String, Object> index, AsyncOperationCallback<T> callback) Veraltet.<T> voidensureIndex(Class<T> cls, String collection, Map<String, Object> index, Map<String, Object> options, AsyncOperationCallback<T> callback) Veraltet.<T> voidensureIndex(Class<T> cls, Map<String, Object> index, AsyncOperationCallback<T> callback) Veraltet.<T> voidensureIndicesFor(Class<T> type) can be called for autmatic index ensurance.<T> voidensureIndicesFor(Class<T> type, AsyncOperationCallback<T> callback) <T> voidensureIndicesFor(Class<T> type, String onCollection) <T> voidensureIndicesFor(Class<T> type, String onCollection, AsyncOperationCallback<T> callback) <T> voidensureIndicesFor(Class<T> type, String onCollection, AsyncOperationCallback<T> callback, MorphiumWriter wr) booleanbooleanboolean<T> List<T>Veraltet.<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<T> T<T> voidfindById(Class<? extends T> type, Object id, String collection, AsyncOperationCallback callback) <T> List<T>findByTemplate(T template, String... fields) Veraltet.voidfirePostDropEvent(Class cls) <T> voidfirePostLoad(List<T> loaded) voidwill be called by query after unmarshalling<T> voidfirePostRemove(List<T> toRemove) voidvoidvoidfirePostStore(Object o, boolean isNew) <T> voidfirePostStore(Map<T, Boolean> isNew) voidvoidfirePreDrop(Class cls) void<T> voidfirePreRemove(List<T> lst) voidvoidfirePreStore(Object o, boolean isNew) voidfirePreStore(Map<Object, Boolean> isNew) voidvoidflush()voidintintintgetCache()getCollStats(Class<?> coll) getCollStats(String coll) longgetDbStats(String db) intgetEstimatedCount(Class<?> type) <T> List<IndexDescription>getIndexesFromEntity(Class<T> type) getIndexesFromMongo(Class cls) getIndexesFromMongo(String collection) getMissingIndicesFor(Class<?> entity) getMissingIndicesFor(Class<?> entity, String collection) getNameProviderForClass(Class<?> cls) int<T> Query<T>getOutdatedLocksQuery(Class<? extends T> cls, int ms) getReadPreferenceForClass(Class<?> cls) getStats()intgetWriteConcernForClass(Class<?> cls) intgetWriterForClass(Class<?> cls) inc(Query<T> query, Enum<?> field, double amount, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) inc(Query<T> query, Enum<?> field, int amount, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) inc(Query<T> query, Enum<?> field, long amount, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) inc(Query<T> query, Enum<?> field, Number amount, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) inc(Query<T> query, String name, double amount, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) inc(Query<T> query, String name, int amount, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) inc(Query<T> query, String name, long amount, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) inc(Query<T> query, String name, Number amount, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) inc(Query<T> query, Map<String, Number> toUpdate, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) voidinc(StatisticKeys k) voidvoidvoidvoidvoidvoidvoidvoidinc(Map<Enum, Number> fieldsToInc, Query<T> matching, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) <T> voidinc(T toSet, Enum<?> field, double i, AsyncOperationCallback<T> callback) <T> voidinc(T toSet, Enum<?> field, int i, AsyncOperationCallback<T> callback) <T> voidinc(T toSet, Enum<?> field, long i, AsyncOperationCallback<T> callback) <T> voidinc(T toSet, Enum<?> collection, Enum<?> field, double i, AsyncOperationCallback<T> callback) <T> voidinc(T toSet, Enum<?> field, Number i, AsyncOperationCallback<T> callback) <T> voidinc(T toSet, String field, double i, AsyncOperationCallback<T> callback) <T> voidinc(T toSet, String field, int i, AsyncOperationCallback<T> callback) <T> voidinc(T toSet, String field, long i, AsyncOperationCallback<T> callback) <T> voidinc(T toSet, String collection, Enum<?> field, double i, AsyncOperationCallback<T> callback) <T> voidinc(T toSet, String collection, Enum<?> field, int i, AsyncOperationCallback<T> callback) <T> voidinc(T toSet, String collection, Enum<?> field, long i, AsyncOperationCallback<T> callback) <T> voidinc(T toSet, String collection, Enum<?> field, Number i, AsyncOperationCallback<T> callback) <T> voidinc(T toSet, String field, Number i, AsyncOperationCallback<T> callback) <T> voidinc(T toSet, String collection, String field, double i, AsyncOperationCallback<T> callback) <T> voidinc(T toSet, String collection, String field, int i, AsyncOperationCallback<T> callback) <T> voidinc(T toSet, String collection, String field, long i, AsyncOperationCallback<T> callback) <T> voidinc(T toSet, String collection, String field, Number i, AsyncOperationCallback<T> callback) <T> voidinsert(T o) <T> voidinsert(T o, AsyncOperationCallback<T> callback) <T> voidinsert(T o, String collection, AsyncOperationCallback<T> callback) <T> voidinsertList(List arrayList) <T> voidinsertList(List arrayList, AsyncOperationCallback<T> callback) <T> voidinsertList(List lst, String collection, AsyncOperationCallback<T> callback) booleanbooleanbooleanbooleanbooleanChecks if javax.validation is available and enables validation support.booleanlistCollections(String pattern) <T> List<T>lockEntities(Query<T> q, String lockId, int maxLockTimeMs) <T> List<T>pull(Query<T> query, String field, Expr value, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) pull(Query<T> query, String field, Object value, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) Asynchronous call to pulllpull(T entity, String field, Expr value, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) void<T> voidpullAll(Query<T> query, String field, List<?> value, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) push(Query<T> query, String field, Object value, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) asynchronous call to callbackvoidvoidvoidvoidpushAll(Query<T> query, String field, List<?> value, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) <T> voidpushPull(boolean push, Query<T> query, String field, Object value, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) <T> voidpushPullAll(boolean push, Query<T> query, String field, List<?> value, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) void<T> List<T>return a list of all elements stored in morphium for this typevoidreconnectToDb(String db) voidreleaseLock(Object obj) voidvoidvoid<T> Treread(T o) careful this actually changes the parameter o!<T> Tvoidreset()void<T> voidsave(List<T> lst, AsyncOperationCallback<T> callback) <T> voidsave(T o) <T> voidsave(T o, AsyncOperationCallback<T> callback) <T> voidsave(T o, String collection, AsyncOperationCallback<T> callback) <T> void<T> voidsaveList(List<T> lst, AsyncOperationCallback<T> callback) <T> void<T> voidsaveList(List<T> lst, String collection, AsyncOperationCallback<T> callback) <T> voidwill change an entry in mongodb-collection corresponding to given class object if query is too complex, upsert might not work!set(Query<T> query, Enum<?> field, Object val, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) set(Query<T> query, Enum<?> field, Object val, AsyncOperationCallback<T> callback) set(Query<T> query, String field, Object val, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) set(Query<T> query, String field, Object val, AsyncOperationCallback<T> callback) set(Query<T> query, Map<String, Object> map, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) <T> void<T> void<T> void<T> voidset(T toSet, Enum<?> field, Object value, boolean upserts, AsyncOperationCallback<T> callback) <T> voidset(T toSet, Enum<?> field, Object value, AsyncOperationCallback<T> callback) <T> void<T> voidset(T toSet, String collection, boolean upserts, Map<Enum, Object> values, AsyncOperationCallback<T> callback) <T> void<T> voidset(T toSet, String collection, Enum field, Object value, boolean upserts, AsyncOperationCallback<T> callback) <T> voidsetting a value in an existing mongo collection entry - no reading necessary.<T> voidset(T toSet, String field, Object value, boolean upserts, AsyncOperationCallback<T> callback) <T> voidset(T toSet, String field, Object value, AsyncOperationCallback<T> callback) <T> voidset(T toSet, String collection, String field, Object value, boolean upserts, AsyncOperationCallback<T> callback) <T> void<T> void<T> voidset(T toSet, String collection, Map<String, Object> values, boolean upserts, AsyncOperationCallback<T> callback) <T> void<T> booleansetAutoValues(T o) voidsetConfig(MorphiumConfig cfg) voidsetDriver(MorphiumDriver drv) voidsetNameProviderForClass(Class<?> cls, NameProvider pro) voidvoid<T> voidstore(List<T> lst, AsyncOperationCallback<T> callback) <T> voidstore(List<T> lst, String collectionName, AsyncOperationCallback<T> callback) <T> voidstore(T o) Stores a single Object.<T> voidstore(T o, AsyncOperationCallback<T> callback) <T> voidstore(T o, String collection, AsyncOperationCallback<T> callback) <T> voidstoreBuffered(T lst) <T> voidstoreBuffered(T lst, AsyncOperationCallback<T> callback) <T> voidstoreBuffered(T lst, String collection, AsyncOperationCallback<T> callback) <T> voidsorts elements in this list, whether to store in background or directly.<T> voidstoreList(List<T> lst, AsyncOperationCallback<T> callback) <T> voidstores all elements of this list to the given collection<T> voidstoreList(List<T> lst, String collection, AsyncOperationCallback<T> callback) <T> voiddirectly 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!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!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!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> voidstoreNoCache(T lst) <T> voidstoreNoCache(T o, AsyncOperationCallback<T> callback) <T> voidstoreNoCache(T o, String collection) <T> voidstoreNoCache(T o, String collection, AsyncOperationCallback<T> callback) toString()<T> void<T> voidunset(T toSet, Enum<?> field, AsyncOperationCallback<T> callback) <T> void<T> voidunset(T toSet, String field, AsyncOperationCallback<T> callback) <T> void<T> voidunset(T toSet, String collection, Enum<?> field, AsyncOperationCallback<T> callback) <T> voidunset(T toSet, String collection, String field, AsyncOperationCallback<T> callback) unsetQ(Query<T> q, boolean multiple, AsyncOperationCallback<T> cb, Enum... field) unsetQ(Query<T> q, AsyncOperationCallback<T> cb, boolean multiple, String... field) unsetQ(Query<T> q, AsyncOperationCallback<T> cb, Enum... field) unsetQ(Query<T> q, AsyncOperationCallback<T> cb, String... field) voidupdateUsingFields(Object ent, Enum... fieldNames) voidupdateUsingFields(Object ent, String... fields) updating an enty in DB without sending the whole entity only transfers the fields to be changed / set<T> voidupdateUsingFields(T ent, AsyncOperationCallback<T> callback, Enum... fields) <T> voidupdateUsingFields(T ent, AsyncOperationCallback<T> callback, String... fields) <T> voidupdateUsingFields(T ent, String collection, AsyncOperationCallback<T> callback, Enum... fields) <T> voidupdateUsingFields(T ent, String collection, AsyncOperationCallback<T> callback, String... fields) <T> voidwatch(Class<T> entity, boolean updateFull, ChangeStreamListener lst) <T> voidwatch(Class<T> entity, boolean updateFull, List<Map<String, Object>> pipeline, ChangeStreamListener lst) <T> voidwatch(String collectionName, boolean updateFull, ChangeStreamListener lst) <T> voidwatch(String collectionName, boolean updateFull, List<Map<String, Object>> pipeline, ChangeStreamListener lst) <T> voidwatch(String collectionName, int maxWaitTime, boolean updateFull, List<Map<String, Object>> pipeline, ChangeStreamListener lst) <T> voidwatchAsync(Class<T> entity, boolean updateFull, ChangeStreamListener lst) <T> voidwatchAsync(Class<T> entity, boolean updateFull, List<Map<String, Object>> pipeline, ChangeStreamListener lst) <T> voidwatchAsync(String collectionName, boolean updateFull, ChangeStreamListener lst) <T> voidwatchAsync(String collectionName, boolean updateFull, List<Map<String, Object>> pipeline, ChangeStreamListener lst) <T> voidwatchDb(boolean updateFull, ChangeStreamListener lst) <T> voidwatchDb(String dbName, boolean updateFull, ChangeStreamListener lst) <T> voidwatchDb(String dbName, boolean updateFull, List<Map<String, Object>> pipeline, AtomicBoolean runningFlag, ChangeStreamListener lst) <T> voidwatchDb(String dbName, int maxWaitTime, boolean updateFull, List<Map<String, Object>> pipeline, AtomicBoolean runningFlag, ChangeStreamListener lst) <T> AtomicBooleanwatchDbAsync(boolean updateFull, AtomicBoolean runningFlag, ChangeStreamListener lst) <T> AtomicBooleanwatchDbAsync(boolean updateFull, List<Map<String, Object>> pipeline, ChangeStreamListener lst) <T> AtomicBooleanwatchDbAsync(String dbName, boolean updateFull, List<Map<String, Object>> pipeline, ChangeStreamListener lst) int
-
Konstruktordetails
-
Morphium
public Morphium() -
Morphium
-
Morphium
-
Morphium
init the MongoDbLayer. Uses Morphium-Configuration Object for Configuration. Needs to be set before use or RuntimeException is thrown! us used for de-referencing and automatical save of referenced entities all logging is done in INFO level- Siehe auch:
-
-
Methodendetails
-
getConfig
-
setConfig
-
getAsyncOperationsThreadPool
-
getValueEncrpytionProvider
-
getEncryptionKeyProvider
-
getCache
-
isValidationEnabled
public boolean isValidationEnabled()Checks if javax.validation is available and enables validation support.- Gibt zurück:
- true, if validation is supported
-
disableValidation
public void disableValidation() -
enableValidation
public void enableValidation() -
listDatabases
-
listCollections
-
listCollections
-
reconnectToDb
-
addListener
-
removeListener
-
getDriver
-
setDriver
-
createMapQuery
-
createQueryByTemplate
-
findByTemplate
Veraltet.search for objects similar to template concerning all given fields. If no fields are specified, all NON Null-Fields are taken into account if specified, field might also be null- Typparameter:
T- - type- Parameter:
template- - what to search forfields- - fields to use for searching- Gibt zurück:
- result of search
-
unset
-
unset
-
unset
-
unset
-
unset
public <T> void unset(T toSet, String collection, Enum<?> field, AsyncOperationCallback<T> callback) -
unset
-
unset
-
unsetQ
-
unsetQ
-
unsetQ
-
unsetQ
-
unsetQ
-
unsetQ
-
unsetQ
-
unsetQ
-
addReplicasetStatusListener
-
removeReplicasetStatusListener
-
runCommand
public List<Map<String,Object>> runCommand(String command, String collection, Map<String, Object> cmdMap) throws MorphiumDriverException- Löst aus:
MorphiumDriverException
-
ensureCapped
automatically convert the collection for the given type to a capped collection only works if @Capped annotation is given for type- Parameter:
c- - type
-
ensureCapped
-
simplifyQueryObject
-
set
-
set
-
set
-
set
-
setEnum
-
push
-
pull
-
push
-
pull
-
push
-
pull
-
pushAll
-
push
-
push
-
push
-
push
-
pullAll
-
push
-
push
public <T> Map<String,Object> push(Query<T> query, String field, Object value, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) asynchronous call to callback- Typparameter:
T- - the type- Parameter:
query- - 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 null
-
addToSet
-
addToSet
-
addToSet
-
addToSet
-
pull
-
pull
public <T> Map<String,Object> pull(Query<T> query, String field, Object value, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) Asynchronous call to pulll- Typparameter:
T- - type- Parameter:
query- - 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 null
-
pull
-
pull
-
pushAll
-
pushAll
-
addAllToSet
-
addAllToSet
-
addAllToSet
-
set
public <T> Map<String,Object> 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! Upsert should consist of single anueries, which will be used to generate the object to create, unless it already exists. look at Mongodb-query documentation as well- Parameter:
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 updated
-
set
-
pullAll
-
set
-
set
-
set
-
set
-
currentDate
public <T> Map<String,Object> currentDate(Query<?> query, String field, boolean upsert, boolean multiple) set current date into one field- Typparameter:
T-- Parameter:
query-field-upsert-multiple-
-
currentDate
-
set
-
set
-
set
-
set
public <T> void set(T toSet, Enum<?> field, Object value, boolean upserts, AsyncOperationCallback<T> callback) -
set
-
set
-
set
-
set
public <T> void set(T toSet, String collection, boolean upserts, Map<Enum, Object> values, AsyncOperationCallback<T> callback) -
set
setting a value in an existing mongo collection entry - no reading necessary. Object is altered in place db.collection.update({"_id":toSet.id},{$set:{field:value}} attention: this alteres the given object toSet in a similar way- Parameter:
toSet- - object to set the value in (or better - the corresponding entry in mongo)field- - the field to changevalue- - the value to set
-
set
public <T> void set(T toSet, String field, Object value, boolean upserts, AsyncOperationCallback<T> callback) -
set
-
set
-
set
-
set
public <T> void set(T toSet, String collection, Map<String, Object> values, boolean upserts, AsyncOperationCallback<T> callback) -
getDbStats
- Löst aus:
MorphiumDriverException
-
getDbStats
- Löst aus:
MorphiumDriverException
-
getCollStats
- Löst aus:
MorphiumDriverException
-
getCollStats
- Löst aus:
MorphiumDriverException
-
set
public <T> void set(T toSet, String collection, Enum field, Object value, boolean upserts, AsyncOperationCallback<T> callback) -
set
public <T> void set(T toSet, String collection, String field, Object value, boolean upserts, AsyncOperationCallback<T> callback) -
set
-
dec
-
dec
-
dec
-
dec
-
dec
-
dec
-
dec
-
dec
-
dec
-
dec
-
dec
-
dec
-
dec
-
dec
-
dec
-
dec
-
inc
-
inc
-
inc
-
inc
-
inc
-
inc
-
inc
-
inc
-
inc
-
inc
-
inc
-
inc
-
inc
-
inc
-
dec
public <T> void dec(Map<Enum, Number> fieldsToInc, Query<T> matching, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) -
dec
-
inc
-
inc
-
inc
-
inc
-
inc
-
inc
-
inc
-
inc
-
inc
-
inc
-
inc
-
inc
-
dec
-
dec
-
dec
-
dec
-
dec
-
dec
-
dec
-
dec
-
getWriterForClass
-
dec
decreasing a value of a given object callesinc(toDec,field,-amount); -
dec
-
dec
-
dec
-
dec
-
dec
-
dec
-
dec
-
inc
-
inc
-
inc
-
inc
-
inc
-
inc
-
inc
-
inc
-
inc
-
inc
-
inc
-
inc
-
inc
-
inc
-
inc
-
inc
-
inc
public <T> void inc(T toSet, Enum<?> collection, Enum<?> field, double i, AsyncOperationCallback<T> callback) -
inc
public <T> void inc(T toSet, String collection, Enum<?> field, double i, AsyncOperationCallback<T> callback) -
inc
public <T> void inc(T toSet, String collection, String field, double i, AsyncOperationCallback<T> callback) -
inc
public <T> void inc(T toSet, String collection, Enum<?> field, int i, AsyncOperationCallback<T> callback) -
inc
public <T> void inc(T toSet, String collection, String field, int i, AsyncOperationCallback<T> callback) -
inc
public <T> void inc(T toSet, String collection, Enum<?> field, long i, AsyncOperationCallback<T> callback) -
inc
public <T> void inc(T toSet, String collection, String field, long i, AsyncOperationCallback<T> callback) -
inc
public <T> void inc(T toSet, String collection, Enum<?> field, Number i, AsyncOperationCallback<T> callback) -
inc
public <T> void inc(T toSet, String collection, String field, Number i, AsyncOperationCallback<T> callback) -
delete
-
delete
-
delete
-
inc
-
updateUsingFields
updating an enty in DB without sending the whole entity only transfers the fields to be changed / set- Parameter:
ent- - entity to updatefields- - fields to use
-
updateUsingFields
-
updateUsingFields
-
updateUsingFields
-
updateUsingFields
public <T> void updateUsingFields(T ent, String collection, AsyncOperationCallback<T> callback, Enum... fields) -
updateUsingFields
public <T> void updateUsingFields(T ent, String collection, AsyncOperationCallback<T> callback, String... fields) -
getMapper
-
getARHelper
-
reread
public <T> T reread(T o) careful this actually changes the parameter o!- Typparameter:
T- - tpye of the object- Parameter:
o- - object to read- Gibt zurück:
- - entity
-
reread
-
firePreStore
-
firePostStore
-
firePreDrop
-
firePostStore
-
firePostRemove
-
firePostLoad
-
firePreStore
-
firePreRemove
-
firePreRemove
-
firePostDropEvent
-
firePostUpdateEvent
-
firePreUpdateEvent
-
firePostRemoveEvent
-
firePostRemoveEvent
-
firePreRemoveEvent
-
deReference
public <T> T deReference(T obj) de-references the given object of type T. If itself or any of its members is a Proxy (PartiallyUpdateableProxy or LazyDeReferencingProxy), it'll be removed and replaced by the real objet. This is not recursive, only the members here are de-referenced- Typparameter:
T- - type- Parameter:
obj- - the object to replact- Gibt zurück:
- the dereferenced object
-
setNameProviderForClass
-
getNameProviderForClass
-
firePostLoadEvent
will be called by query after unmarshalling- Parameter:
o- - entitiy
-
getCurrentRSState
-
isReplicaSet
public boolean isReplicaSet() -
getReadPreferenceForClass
-
createBulkRequestContext
-
createBulkRequestContext
-
getWriteConcernForClass
-
clearCollection
issues a remove command - no lifecycle methods calles, no drop, keeps all indexec this way- Parameter:
cls- - class
-
clearCollection
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- Parameter:
cls- - classcolName- - CollectionName
-
clearCollectionOneByOne
clears every single object in collection - reads ALL objects to do so this way Lifecycle methods can be called!- Parameter:
cls- -class
-
readAll
return a list of all elements stored in morphium for this type- Typparameter:
T- - Type- Parameter:
cls- - type to search for, needs to be an Property- Gibt zurück:
- - list of all elements stored
-
createQueryFor
-
createQueryFor
-
getEstimatedCount
-
getCount
-
find
Veraltet.use query.asList() instead- Typparameter:
T-- Parameter:
q-- Gibt zurück:
-
distinct
-
distinct
returns a distinct list of values of the given collection Attention: these values are not unmarshalled, you might get MongoMapUngültige Eingabe: "<"String,Object>s -
distinct
returns a distinct list of values of the given collection Attention: these values are not unmarshalled, you might get MongoMapUngültige Eingabe: "<"String,Object>s -
distinct
-
distinct
-
distinct
-
distinct
-
findById
-
findById
public <T> void findById(Class<? extends T> type, Object id, String collection, AsyncOperationCallback callback) -
findById
-
findByField
-
findByField
-
setAutoValues
- Löst aus:
IllegalAccessException
-
clearCachefor
Erase cache entries for the given type. is being called after every store depending on cache settings!- Parameter:
cls- - class
-
clearCacheforClassIfNecessary
-
storeNoCache
public <T> void storeNoCache(T lst) -
storeNoCache
-
storeNoCache
-
storeNoCache
-
storeBuffered
public <T> void storeBuffered(T lst) -
storeBuffered
-
storeBuffered
-
flush
public void flush() -
flush
-
getId
-
dropCollection
-
dropCollection
-
dropCollection
-
ensureIndicesFor
can be called for autmatic index ensurance. Attention: might cause heavy load on mongo- Parameter:
type- type to ensure indices for
-
ensureIndicesFor
-
ensureIndicesFor
-
ensureIndicesFor
public <T> void ensureIndicesFor(Class<T> type, String onCollection, AsyncOperationCallback<T> callback) -
ensureIndicesFor
public <T> void ensureIndicesFor(Class<T> type, String onCollection, AsyncOperationCallback<T> callback, MorphiumWriter wr) -
ensureIndex
Veraltet. -
ensureIndex
@Deprecated public void ensureIndex(Class<?> cls, String collection, Map<String, Object> index, Map<String, Object> options) Veraltet. -
ensureIndex
Veraltet. -
ensureIndex
@Deprecated public <T> void ensureIndex(Class<T> cls, AsyncOperationCallback<T> callback, Enum... fldStr) Veraltet.ensureIndex(CachedObject.class,"counter","-value"); ensureIndex(CachedObject.class,"counter:2d","-value); Similar to sorting- Parameter:
cls- - classfldStr- - fields
-
ensureIndex
@Deprecated public <T> void ensureIndex(Class<T> cls, String collection, AsyncOperationCallback<T> callback, Enum... fldStr) Veraltet. -
ensureIndex
@Deprecated public <T> void ensureIndex(Class<T> cls, AsyncOperationCallback<T> callback, String... fldStr) Veraltet. -
ensureIndex
@Deprecated public <T> void ensureIndex(Class<T> cls, String collection, AsyncOperationCallback<T> callback, String... fldStr) Veraltet. -
ensureIndex
@Deprecated public <T> void ensureIndex(Class<T> cls, Map<String, Object> index, AsyncOperationCallback<T> callback) Veraltet. -
ensureIndex
@Deprecated public <T> void ensureIndex(Class<T> cls, String collection, Map<String, Object> index, Map<String, Object> options, AsyncOperationCallback<T> callback) Veraltet. -
ensureIndex
@Deprecated public <T> void ensureIndex(Class<T> cls, String collection, Map<String, Object> index, AsyncOperationCallback<T> callback) Veraltet. -
createIndex
public <T> void createIndex(Class<T> cls, String collection, IndexDescription index, AsyncOperationCallback<T> callback) -
getIndexesFromMongo
-
getIndexesFromMongo
-
getIndexesFromEntity
-
writeBufferCount
public int writeBufferCount() -
store
-
createIndexKeyMapFrom
-
getDatabase
-
ensureIndex
-
ensureIndex
-
insert
public <T> void insert(T o) -
insert
-
insert
-
insertList
-
insertList
-
insertList
-
storeMaps
public Map<String,Integer> storeMaps(Class type, List<Map<String, Object>> lst) throws MorphiumDriverExceptiondirectly 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!- Parameter:
type- - type to write to (just for determining collection name)lst- - list of entries to write- Gibt zurück:
- statistics
- Löst aus:
MorphiumDriverException
-
saveMaps
public Map<String,Integer> saveMaps(Class type, List<Map<String, Object>> lst) throws MorphiumDriverException- Löst aus:
MorphiumDriverException
-
storeMaps
public Map<String,Integer> storeMaps(String collection, List<Map<String, Object>> lst) throws MorphiumDriverExceptiondirectly 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!- Parameter:
collection- - name of colleciton to write tolst- - list of entries to write- Gibt zurück:
- statistics
- Löst aus:
MorphiumDriverException
-
saveMaps
public Map<String,Integer> saveMaps(String collection, List<Map<String, Object>> lst) throws MorphiumDriverException- Löst aus:
MorphiumDriverException
-
storeMap
public Map<String,Integer> storeMap(String collection, Map<String, Object> m) throws MorphiumDriverExceptiondirectly 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!- Parameter:
collection- collection namem- data to write- Gibt zurück:
- statistics
- Löst aus:
MorphiumDriverException
-
saveMap
public Map<String,Integer> saveMap(String collection, Map<String, Object> m) throws MorphiumDriverException- Löst aus:
MorphiumDriverException
-
storeMap
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!- Parameter:
type- - type, used to determine collection namem- - data to write- Gibt zurück:
- statistics
- Löst aus:
MorphiumDriverException
-
store
public <T> void store(T o) Stores a single Object. Clears the corresponding cache- Parameter:
o- - Object to store
-
save
public <T> void save(T o) -
store
-
save
-
store
-
save
-
save
-
store
-
storeList
stores all elements of this list to the given collection- Typparameter:
T- - type of entity- Parameter:
lst- - list of objects to storecollection- - collection name to use
-
saveList
-
storeList
-
saveList
-
storeList
sorts elements in this list, whether to store in background or directly.- Typparameter:
T- - type of list elements- Parameter:
lst- - all objects are sorted whether to store in BG or direclty. All objects are stored in their corresponding collection
-
saveList
-
storeList
-
saveList
-
storeList
-
saveList
-
delete
-
delete
-
pushPull
public <T> void pushPull(boolean push, Query<T> query, String field, Object value, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) -
pushPullAll
public <T> void pushPullAll(boolean push, Query<T> query, String field, List<?> value, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) -
pullAll
public <T> void pullAll(Query<T> query, String field, List<?> value, boolean upsert, boolean multiple, AsyncOperationCallback<T> callback) -
delete
deletes a single object from morphium backend. Clears cache- Parameter:
o- - entity
-
delete
-
delete
-
delete
-
exists
- Löst aus:
MorphiumDriverException
-
exists
- Löst aus:
MorphiumDriverException
-
exists
- Löst aus:
MorphiumDriverException
-
getStatistics
-
resetStatistics
public void resetStatistics() -
getStats
-
getShutDownListeners
-
addShutdownListener
-
removeShutdownListener
-
close
public void close()- Angegeben von:
closein SchnittstelleAutoCloseable
-
createCamelCase
-
mapReduce
public <T> List<T> mapReduce(Class<? extends T> type, String map, String reduce) throws MorphiumDriverException - Löst aus:
MorphiumDriverException
-
createAggregator
public <T,R> Aggregator<T,R> createAggregator(Class<? extends T> type, Class<? extends R> resultType) -
createLazyLoadedEntity
-
getWriteBufferCount
public int getWriteBufferCount() -
getBufferedWriterBufferCount
public int getBufferedWriterBufferCount() -
getAsyncWriterBufferCount
public int getAsyncWriterBufferCount() -
getWriterBufferCount
public int getWriterBufferCount() -
disableAutoValuesForThread
public void disableAutoValuesForThread() -
enableAutoValuesForThread
public void enableAutoValuesForThread() -
isAutoValuesEnabledForThread
public boolean isAutoValuesEnabledForThread() -
disableReadCacheForThread
public void disableReadCacheForThread() -
enableReadCacheForThread
public void enableReadCacheForThread() -
isReadCacheEnabledForThread
public boolean isReadCacheEnabledForThread() -
disableWriteBufferForThread
public void disableWriteBufferForThread() -
enableWriteBufferForThread
public void enableWriteBufferForThread() -
isWriteBufferEnabledForThread
public boolean isWriteBufferEnabledForThread() -
disableAsyncWritesForThread
public void disableAsyncWritesForThread() -
enableAsyncWritesForThread
public void enableAsyncWritesForThread() -
isAsyncWritesEnabledForThread
public boolean isAsyncWritesEnabledForThread() -
queueTask
-
getNumberOfAvailableThreads
public int getNumberOfAvailableThreads() -
getActiveThreads
public int getActiveThreads() -
startTransaction
public void startTransaction() -
getTransaction
-
setTransaction
-
commitTransaction
public void commitTransaction() -
abortTransaction
public void abortTransaction() -
watchAsync
-
watchAsync
-
watchAsync
-
watchAsync
-
watch
-
watch
-
watch
-
watch
-
watch
-
watchDbAsync
public <T> AtomicBoolean watchDbAsync(String dbName, boolean updateFull, List<Map<String, Object>> pipeline, ChangeStreamListener lst) -
watchDbAsync
public <T> AtomicBoolean watchDbAsync(boolean updateFull, AtomicBoolean runningFlag, ChangeStreamListener lst) -
watchDbAsync
public <T> AtomicBoolean watchDbAsync(boolean updateFull, List<Map<String, Object>> pipeline, ChangeStreamListener lst) -
watchDb
-
watchDb
-
watchDb
public <T> void watchDb(String dbName, boolean updateFull, List<Map<String, Object>> pipeline, AtomicBoolean runningFlag, ChangeStreamListener lst) -
watchDb
public <T> void watchDb(String dbName, int maxWaitTime, boolean updateFull, List<Map<String, Object>> pipeline, AtomicBoolean runningFlag, ChangeStreamListener lst) -
reset
public void reset() -
getMissingIndicesFor
- Löst aus:
MorphiumDriverException
-
getMissingIndicesFor
public List<IndexDescription> getMissingIndicesFor(Class<?> entity, String collection) throws MorphiumDriverException - Löst aus:
MorphiumDriverException
-
checkIndices
run trhough classpath, find all Entities, check indices returns a list of Entities, whos indices are missing or different -
checkCapped
-
checkIndices
public Map<Class<?>,List<IndexDescription>> checkIndices(io.github.classgraph.ClassInfoList.ClassInfoFilter filter) -
getOutdatedLocksQuery
-
lockEntities
public <T> List<T> lockEntities(Query<T> q, String lockId, int maxLockTimeMs) throws MorphiumDriverException - Löst aus:
MorphiumDriverException
-
releaseLock
- Löst aus:
MorphiumDriverException
-
toString
-