Query.TextSearchLanguages| Constructor and Description |
|---|
QueryImpl() |
QueryImpl(Morphium m) |
QueryImpl(Morphium m,
Class<? extends T> type,
ThreadPoolExecutor executor) |
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(FilterExpression ex)
needed for creation of the query representation tree
|
MorphiumIterator<T> |
asIterable()
create an iterator / iterable for this query, default windowSize (10)
|
MorphiumIterator<T> |
asIterable(int windowSize)
create an iterator / iterable for this query, sets window size (how many objects should be read from DB)
|
List<T> |
asList()
the result as list
|
void |
asList(AsyncOperationCallback<T> callback) |
Query<T> |
clone() |
List<T> |
complexQuery(com.mongodb.DBObject query) |
List<T> |
complexQuery(com.mongodb.DBObject query,
Map<String,Integer> sort,
int skip,
int limit)
just sends the given query to the MongoDBDriver and masrhalls objects as listed
ignores all other query settings!!!!!
|
List<T> |
complexQuery(com.mongodb.DBObject query,
String sort,
int skip,
int limit) |
T |
complexQueryOne(com.mongodb.DBObject query)
same as copmplexQuery(query,0,1).get(0);
|
T |
complexQueryOne(com.mongodb.DBObject query,
Map<String,Integer> sort) |
T |
complexQueryOne(com.mongodb.DBObject query,
Map<String,Integer> sort,
int skip) |
long |
countAll()
count all results in query - does not take limit or skip into account
|
void |
countAll(AsyncOperationCallback<T> c) |
MongoField<T> |
f(Enum... f) |
MongoField<T> |
f(Enum f)
same as f(field.name())
|
MongoField<T> |
f(String... f) |
MongoField<T> |
f(String f)
Get a field.
|
T |
get()
get only 1 result (first one in result list)
|
void |
get(AsyncOperationCallback<T> callback) |
T |
getById(Object id) |
void |
getById(Object id,
AsyncOperationCallback<T> callback) |
String |
getCollectionName() |
ThreadPoolExecutor |
getExecutor() |
int |
getLimit() |
Morphium |
getMorphium() |
int |
getNumberOfPendingRequests() |
com.mongodb.ReadPreference |
getReadPreference()
retrun mongo's readPreference
|
ReadPreferenceLevel |
getReadPreferenceLevel() |
com.mongodb.ServerAddress |
getServer()
returns the serveraddress the query was executed on
|
int |
getSkip() |
Map<String,Integer> |
getSort() |
Class<? extends T> |
getType()
what type this query is for
|
String |
getWhere() |
<R> List<R> |
idList()
only return the IDs of objects (useful if objects are really large)
|
void |
idList(AsyncOperationCallback<T> callback) |
Query<T> |
limit(int i)
limit the number of entries in result
|
Query<T> |
nor(Query<T>... qs)
not or
|
Query<T> |
or(List<Query<T>> qs)
concatenate those queries with or
|
Query<T> |
or(Query<T>... qs)
concatenate those queries with or
|
Query<T> |
q()
create a new empty query for the same type using the same mapper as this
|
void |
setCollectionName(String n)
use a different collection name for the query
|
void |
setExecutor(ThreadPoolExecutor executor) |
void |
setMorphium(Morphium m) |
void |
setReadPreference(com.mongodb.ReadPreference readPreference) |
void |
setReadPreferenceLevel(ReadPreferenceLevel readPreferenceLevel) |
void |
setType(Class<? extends T> type)
what type to use
|
Query<T> |
skip(int i)
skip the first entries in result
|
Query<T> |
sort(Enum... naturalOrder) |
Query<T> |
sort(Map<String,Integer> n)
this does not check for existence of the Field!
|
Query<T> |
sort(String... prefixedString)
set order by prefixing field names with - for reverse ordering (+ or nothing default)
|
List<T> |
textSearch(Query.TextSearchLanguages lang,
String... texts) |
List<T> |
textSearch(String... texts) |
com.mongodb.DBObject |
toQueryObject()
create a db object from this query and all of it's child nodes
|
String |
toString() |
Query<T> |
where(String wh)
set the where string for this query - where-String needs to be valid java script!
|
public QueryImpl()
public QueryImpl(Morphium m, Class<? extends T> type, ThreadPoolExecutor executor)
public QueryImpl(Morphium m)
public com.mongodb.ServerAddress getServer()
Querypublic ThreadPoolExecutor getExecutor()
public void setExecutor(ThreadPoolExecutor executor)
setExecutor in interface Query<T>public Morphium getMorphium()
getMorphium in interface Query<T>public void setMorphium(Morphium m)
setMorphium in interface Query<T>public ReadPreferenceLevel getReadPreferenceLevel()
getReadPreferenceLevel in interface Query<T>public void setReadPreferenceLevel(ReadPreferenceLevel readPreferenceLevel)
setReadPreferenceLevel in interface Query<T>public Query<T> q()
Querypublic List<T> complexQuery(com.mongodb.DBObject query)
complexQuery in interface Query<T>public List<T> complexQuery(com.mongodb.DBObject query, String sort, int skip, int limit)
complexQuery in interface Query<T>public List<T> complexQuery(com.mongodb.DBObject query, Map<String,Integer> sort, int skip, int limit)
QuerycomplexQuery in interface Query<T>query - - query to be sentskip - - amount to skiplimit - - maximium number of resultspublic T complexQueryOne(com.mongodb.DBObject query)
QuerycomplexQueryOne in interface Query<T>query - - querypublic T complexQueryOne(com.mongodb.DBObject query, Map<String,Integer> sort, int skip)
complexQueryOne in interface Query<T>public T complexQueryOne(com.mongodb.DBObject query, Map<String,Integer> sort)
complexQueryOne in interface Query<T>public void addChild(FilterExpression ex)
Querypublic Query<T> where(String wh)
Querypublic MongoField<T> f(Enum f)
Querypublic MongoField<T> f(String f)
Querypublic Query<T> or(Query<T>... qs)
Querypublic Query<T> or(List<Query<T>> qs)
Querypublic Query<T> limit(int i)
Querypublic Query<T> skip(int i)
Querypublic Query<T> sort(Map<String,Integer> n)
public Query<T> sort(String... prefixedString)
Querypublic void countAll(AsyncOperationCallback<T> c)
public long countAll()
Querypublic com.mongodb.ReadPreference getReadPreference()
public void setReadPreference(com.mongodb.ReadPreference readPreference)
public com.mongodb.DBObject toQueryObject()
QuerytoQueryObject in interface Query<T>public Class<? extends T> getType()
Querypublic void setType(Class<? extends T> type)
Querypublic void asList(AsyncOperationCallback<T> callback)
public MorphiumIterator<T> asIterable()
QueryasIterable in interface Query<T>public MorphiumIterator<T> asIterable(int windowSize)
QueryasIterable in interface Query<T>public void getById(Object id, AsyncOperationCallback<T> callback)
public void get(AsyncOperationCallback<T> callback)
public T get()
Querypublic void idList(AsyncOperationCallback<T> callback)
public <R> List<R> idList()
Querypublic Query<T> clone() throws CloneNotSupportedException
public int getNumberOfPendingRequests()
getNumberOfPendingRequests in interface Query<T>public String getCollectionName()
getCollectionName in interface Query<T>public void setCollectionName(String n)
QuerysetCollectionName in interface Query<T>public List<T> textSearch(String... texts)
textSearch in interface Query<T>public List<T> textSearch(Query.TextSearchLanguages lang, String... texts)
textSearch in interface Query<T>Copyright © 2013. All rights reserved.