Package de.caluga.morphium.query
Class Query<T>
- java.lang.Object
-
- de.caluga.morphium.query.Query<T>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classQuery.TextSearchLanguages
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Query<T>addChild(FilterExpression ex)Query<T>addProjection(Enum f)Query<T>addProjection(Enum f, String projectOperator)Query<T>addProjection(String f)Query<T>addProjection(String f, String projectOperator)Query<T>addTag(String name, String value)QueryIterator<T>asIterable()QueryIterator<T>asIterable(int windowSize)QueryIterator<T>asIterable(int windowSize, Class<? extends QueryIterator<T>> it)QueryIterator<T>asIterable(QueryIterator<T> ret)List<T>asList()voidasList(AsyncOperationCallback<T> callback)QueryIterator<Map<String,Object>>asMapIterable()List<Map<String,Object>>asMapList()Query<T>clone()List<T>complexQuery(Map<String,Object> query)Deprecated.List<T>complexQuery(Map<String,Object> query, String sort, int skip, int limit)use rawQuery() insteadList<T>complexQuery(Map<String,Object> query, Map<String,Integer> sort, int skip, int limit)Deprecated.longcomplexQueryCount(Map<String,Object> query)TcomplexQueryOne(Map<String,Object> query)TcomplexQueryOne(Map<String,Object> query, Map<String,Integer> sort)TcomplexQueryOne(Map<String,Object> query, Map<String,Integer> sort, int skip)longcountAll()voidcountAll(AsyncOperationCallback<T> c)voiddec(Enum field, Double value)voiddec(Enum field, Double value, boolean upsert, boolean multiple)voiddec(Enum field, Double value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)voiddec(Enum field, Integer value)voiddec(Enum field, Integer value, boolean upsert, boolean multiple)voiddec(Enum field, Integer value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)voiddec(Enum field, Long value)voiddec(Enum field, Long value, boolean upsert, boolean multiple)voiddec(Enum field, Long value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)voiddec(Enum field, Number value)voiddec(Enum field, Number value, boolean upsert, boolean multiple)voiddec(Enum field, Number value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)voiddec(String field, Double value)voiddec(String field, Double value, boolean upsert, boolean multiple)voiddec(String field, Double value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)voiddec(String field, Integer value)voiddec(String field, Integer value, boolean upsert, boolean multiple)voiddec(String field, Integer value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)voiddec(String field, Long value)voiddec(String field, Long value, boolean upsert, boolean multiple)voiddec(String field, Long value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)voiddec(String field, Number value)voiddec(String field, Number value, boolean upsert, boolean multiple)voiddec(String field, Number value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)voiddelete()Query<T>disableAutoValues()Listdistinct(String field)Query<T>enableAutoValues()Query<T>expr(Expr exp)MongoField<T>f(Enum f)MongoField<T>f(Enum... f)MongoField<T>f(String f)MongoField<T>f(String... f)TfindOneAndDelete()TfindOneAndUpdate(Map<String,Object> update)TfindOneAndUpdateEnums(Map<Enum,Object> update)Tget()voidget(AsyncOperationCallback<T> callback)AnnotationAndReflectionHelpergetARHelper()intgetBatchSize()TgetById(Object id)Deprecated.voidgetById(Object id, AsyncOperationCallback<T> callback)Deprecated.CollationgetCollation()StringgetCollectionName()MorphiumCursorgetCursor()StringgetDB()ThreadPoolExecutorgetExecutor()Map<String,Object>getFieldListForQuery()FindCommandgetFindCmd()intgetLimit()MorphiumgetMorphium()intgetNumberOfPendingRequests()ReadPreferenceLevelgetReadPreferenceLevel()StringgetServer()intgetSkip()Map<String,Object>getSort()String[]getTags()Class<? extends T>getType()StringgetWhere()Query<T>hideFieldInProjection(Enum f)Query<T>hideFieldInProjection(String f)<R> List<R>idList()voididList(AsyncOperationCallback<T> callback)Map<String,Object>inc(Enum field, Double value)Map<String,Object>inc(Enum field, Double value, boolean upsert, boolean multiple)Map<String,Object>inc(Enum field, Double value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)Map<String,Object>inc(Enum field, Integer value)Map<String,Object>inc(Enum field, Integer value, boolean upsert, boolean multiple)Map<String,Object>inc(Enum field, Integer value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)Map<String,Object>inc(Enum field, Long value)Map<String,Object>inc(Enum field, Long value, boolean upsert, boolean multiple)Map<String,Object>inc(Enum field, Long value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)Map<String,Object>inc(Enum field, Number value)Map<String,Object>inc(Enum field, Number value, boolean upsert, boolean multiple)Map<String,Object>inc(Enum field, Number value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)Map<String,Object>inc(String field, Double value)Map<String,Object>inc(String field, Double value, boolean upsert, boolean multiple)Map<String,Object>inc(String field, Double value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)Map<String,Object>inc(String field, Integer value)Map<String,Object>inc(String field, Integer value, boolean upsert, boolean multiple)Map<String,Object>inc(String field, Integer value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)Map<String,Object>inc(String field, Long value)Map<String,Object>inc(String field, Long value, boolean upsert, boolean multiple)Map<String,Object>inc(String field, Long value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)Map<String,Object>inc(String field, Number value)Map<String,Object>inc(String field, Number value, boolean upsert, boolean multiple)Map<String,Object>inc(String field, Number value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)booleanisAutoValuesEnabled()Query<T>limit(int i)Query<T>matchesJsonSchema(String schemaDef)Query<T>matchesJsonSchema(Map<String,Object> schemaDef)Query<T>nor(Query<T>... qs)Query<T>or(Query<T>... qs)Query<T>or(List<Query<T>> qs)voidoverrideDB(String overrideDB)voidpull(Enum field, Expr value)voidpull(Enum field, Expr value, boolean upsert, boolean multiple)voidpull(Enum field, Expr value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)voidpull(Enum field, Object value)voidpull(Enum field, Object value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)voidpull(String field, Object value)voidpull(String field, Object value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)voidpullAll(Enum field, List value)voidpullAll(Enum field, List value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)voidpullAll(String field, List value)voidpullAll(String field, List value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)voidpush(Enum field, Object value)voidpush(Enum field, Object value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)voidpush(String field, Object value)voidpush(String field, Object value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)voidpushAll(Enum field, List value)voidpushAll(Enum field, List value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)voidpushAll(String field, List value)voidpushAll(String field, List value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)Query<T>q()Query<T>rawQuery(Map<String,Object> query)Map<String,Object>set(Enum field, Object value)Map<String,Object>set(Enum field, Object value, boolean upsert, boolean multiple)Map<String,Object>set(Enum field, Object value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)Map<String,Object>set(Enum field, Object value, AsyncOperationCallback<T> cb)Map<String,Object>set(String field, Object value)Map<String,Object>set(String field, Object value, boolean upsert, boolean multiple)Map<String,Object>set(String field, Object value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)Map<String,Object>set(String field, Object value, AsyncOperationCallback<T> cb)Map<String,Object>set(Map<String,Object> map)Map<String,Object>set(Map<String,Object> map, boolean upsert, boolean multiple)Map<String,Object>set(Map<String,Object> map, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)Map<String,Object>set(Map<String,Object> map, AsyncOperationCallback<T> cb)voidsetARHelper(AnnotationAndReflectionHelper ar)Query<T>setAutoValuesEnabled(boolean autoValuesEnabled)Query<T>setBatchSize(int batchSize)Query<T>setCollation(Collation collation)Query<T>setCollectionName(String n)Map<String,Object>setEnum(Map<Enum,Object> map)Map<String,Object>setEnum(Map<Enum,Object> map, boolean upsert, boolean multiple)Map<String,Object>setEnum(Map<Enum,Object> map, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)Map<String,Object>setEnum(Map<Enum,Object> map, AsyncOperationCallback<T> cb)voidsetExecutor(ThreadPoolExecutor executor)voidsetMorphium(Morphium m)Query<T>setProjection(Enum... fl)Query<T>setProjection(String... fl)voidsetReadPreferenceLevel(ReadPreferenceLevel readPreferenceLevel)voidsetType(Class<? extends T> type)Query<T>skip(int i)Query<T>sort(Enum... naturalOrder)Query<T>sort(String... prefixedString)Query<T>sort(Map<String,Integer> n)this does not check for existence of the Field!Query<T>sortEnum(Map<Enum,Integer> n)voidtail(int batchSize, int maxWait, AsyncOperationCallback<T> cb)do a tail queryQuery<T>text(Query.TextSearchLanguages lang, boolean caseSensitive, boolean diacriticSensitive, String... text)Query<T>text(Query.TextSearchLanguages lang, String... text)Query<T>text(String... text)Query<T>text(String metaScoreField, Query.TextSearchLanguages lang, boolean caseSensitive, boolean diacriticSensitive, String... text)Query<T>text(String metaScoreField, Query.TextSearchLanguages lang, String... text)List<T>textSearch(Query.TextSearchLanguages lang, String... texts)Deprecated.List<T>textSearch(String... texts)Deprecated.Map<String,Object>toQueryObject()StringtoString()Query<T>where(String wh)
-
-
-
Constructor Detail
-
Query
public Query(Morphium m, Class<? extends T> type, ThreadPoolExecutor executor)
-
Query
public Query(Morphium m)
-
-
Method Detail
-
getBatchSize
public int getBatchSize()
-
getCollation
public Collation getCollation()
-
getDB
public String getDB()
-
overrideDB
public void overrideDB(String overrideDB)
-
getTags
public String[] getTags()
-
isAutoValuesEnabled
public boolean isAutoValuesEnabled()
-
getServer
public String getServer()
-
getExecutor
public ThreadPoolExecutor getExecutor()
-
setExecutor
public void setExecutor(ThreadPoolExecutor executor)
-
getWhere
public String getWhere()
-
getMorphium
public Morphium getMorphium()
-
setMorphium
public void setMorphium(Morphium m)
-
getReadPreferenceLevel
public ReadPreferenceLevel getReadPreferenceLevel()
-
setReadPreferenceLevel
public void setReadPreferenceLevel(ReadPreferenceLevel readPreferenceLevel)
-
complexQuery
@Deprecated public List<T> complexQuery(Map<String,Object> query)
Deprecated.use rawQuery instead- Parameters:
query-- Returns:
-
complexQuery
public List<T> complexQuery(Map<String,Object> query, String sort, int skip, int limit)
use rawQuery() instead- Parameters:
query-sort-skip-limit-- Returns:
-
findOneAndDelete
public T findOneAndDelete()
-
getARHelper
public AnnotationAndReflectionHelper getARHelper()
-
setARHelper
public void setARHelper(AnnotationAndReflectionHelper ar)
-
complexQuery
@Deprecated public List<T> complexQuery(Map<String,Object> query, Map<String,Integer> sort, int skip, int limit)
Deprecated.use rawQuery to set query, and standard API- Parameters:
query- - query to be sentsort-skip- - amount to skiplimit- - maximium number of results- Returns:
-
complexQueryOne
public T complexQueryOne(Map<String,Object> query, Map<String,Integer> sort, int skip)
-
getLimit
public int getLimit()
-
getSkip
public int getSkip()
-
addChild
public Query<T> addChild(FilterExpression ex)
-
f
public MongoField<T> f(Enum f)
-
f
public MongoField<T> f(String... f)
-
f
public MongoField<T> f(Enum... f)
-
f
public MongoField<T> f(String f)
-
or
@SafeVarargs public final Query<T> or(Query<T>... qs)
-
nor
@SafeVarargs public final Query<T> nor(Query<T>... qs)
-
sort
public Query<T> sort(Map<String,Integer> n)
this does not check for existence of the Field! Key in the map can be any text- Parameters:
n-- Returns:
-
countAll
public void countAll(AsyncOperationCallback<T> c)
-
countAll
public long countAll()
-
matchesJsonSchema
public Query<T> matchesJsonSchema(String schemaDef) throws org.json.simple.parser.ParseException
- Throws:
org.json.simple.parser.ParseException
-
asList
public void asList(AsyncOperationCallback<T> callback)
-
asMapIterable
public QueryIterator<Map<String,Object>> asMapIterable()
-
asIterable
public QueryIterator<T> asIterable()
-
asIterable
public QueryIterator<T> asIterable(int windowSize)
-
asIterable
public QueryIterator<T> asIterable(QueryIterator<T> ret)
-
getCursor
public MorphiumCursor getCursor() throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
asIterable
public QueryIterator<T> asIterable(int windowSize, Class<? extends QueryIterator<T>> it)
-
getById
@Deprecated public void getById(Object id, AsyncOperationCallback<T> callback)
Deprecated.
-
getById
@Deprecated public T getById(Object id)
Deprecated.
-
get
public void get(AsyncOperationCallback<T> callback)
-
get
public T get()
-
idList
public void idList(AsyncOperationCallback<T> callback)
-
idList
public <R> List<R> idList()
-
delete
public void delete()
-
set
public Map<String,Object> set(String field, Object value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
-
set
public Map<String,Object> set(Enum field, Object value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
-
setEnum
public Map<String,Object> setEnum(Map<Enum,Object> map, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
-
set
public Map<String,Object> set(Map<String,Object> map, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
-
setEnum
public Map<String,Object> setEnum(Map<Enum,Object> map, boolean upsert, boolean multiple)
-
push
public void push(String field, Object value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
-
push
public void push(Enum field, Object value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
-
pushAll
public void pushAll(String field, List value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
-
pushAll
public void pushAll(Enum field, List value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
-
pullAll
public void pullAll(String field, List value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
-
pullAll
public void pullAll(Enum field, List value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
-
pull
public void pull(String field, Object value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
-
pull
public void pull(Enum field, Object value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
-
pull
public void pull(Enum field, Expr value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
-
inc
public Map<String,Object> inc(String field, Integer value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
-
inc
public Map<String,Object> inc(String field, Double value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
-
inc
public Map<String,Object> inc(Enum field, Number value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
-
inc
public Map<String,Object> inc(Enum field, Integer value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
-
inc
public Map<String,Object> inc(Enum field, Double value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
-
inc
public Map<String,Object> inc(Enum field, Long value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
-
inc
public Map<String,Object> inc(String field, Long value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
-
inc
public Map<String,Object> inc(String field, Number value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
-
dec
public void dec(Enum field, Integer value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
-
dec
public void dec(String field, Integer value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
-
dec
public void dec(Enum field, Double value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
-
dec
public void dec(String field, Double value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
-
dec
public void dec(Enum field, Long value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
-
dec
public void dec(String field, Long value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
-
dec
public void dec(Enum field, Number value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
-
dec
public void dec(String field, Number value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
-
getNumberOfPendingRequests
public int getNumberOfPendingRequests()
-
getCollectionName
public String getCollectionName()
-
text
public Query<T> text(Query.TextSearchLanguages lang, String... text)
-
text
public Query<T> text(Query.TextSearchLanguages lang, boolean caseSensitive, boolean diacriticSensitive, String... text)
-
text
public Query<T> text(String metaScoreField, Query.TextSearchLanguages lang, boolean caseSensitive, boolean diacriticSensitive, String... text)
-
text
public Query<T> text(String metaScoreField, Query.TextSearchLanguages lang, String... text)
-
textSearch
@Deprecated public List<T> textSearch(String... texts)
Deprecated.
-
textSearch
@Deprecated public List<T> textSearch(Query.TextSearchLanguages lang, String... texts)
Deprecated.
-
tail
public void tail(int batchSize, int maxWait, AsyncOperationCallback<T> cb)do a tail query- Parameters:
batchSize- - determins how much data is read in one stepmaxWait- - how long to wait _at most_ for data, throws Exception otherwisecb- - the callback being called for _every single document_ - the entity field is filled, lists will be null
-
getFindCmd
public FindCommand getFindCmd()
-
-