| Constructor and Description |
|---|
QueryImpl(Morphium m) |
QueryImpl(Morphium m,
Class<T> type,
ObjectMapper map) |
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(FilterExpression ex)
needed for creation of the query representation tree
|
List<T> |
asList()
the result as list
|
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
|
MongoField |
f(Enum f)
same as f(field.name())
|
MongoField |
f(String f)
Get a field.
|
T |
get()
get only 1 result (first one in result list)
|
T |
getById(org.bson.types.ObjectId id)
returns one object that matches to id
|
int |
getLimit() |
ObjectMapper |
getMapper()
get the current mapper implmenentation
|
Map<String,Integer> |
getOrder() |
ReadPreferenceLevel |
getReadPreferenceLevel() |
int |
getSkip() |
Class<T> |
getType()
what type this query is for
|
List<org.bson.types.ObjectId> |
idList()
only return the IDs of objects (useful if objects are really large)
|
Query<T> |
limit(int i)
limit the number of entries in result
|
void |
nor(Query<T>... qs)
not or
|
void |
or(Query<T>... qs)
concatenate those queries with or
|
Query<T> |
order(Map<String,Integer> n)
set an order - Key: FieldName (java or Mongo-Name), Value: Integer: -1 reverse, 1 standard
deprectaed, use sort instead (more like the maongodb-commands)... used for backward compatibility.
|
Query<T> |
order(String... prefixedString)
set order by prefixing field names with - for reverse ordering (+ or nothing default)
deprectaed, use sort instead (more like the maongodb-commands)... used for backward compatibility.
|
Query<T> |
q()
create a new empty query for the same type using the same mapper as this
|
void |
setMapper(ObjectMapper mapper)
set the object Mapper this query object should use.
|
void |
setReadPreferenceLevel(ReadPreferenceLevel readPreferenceLevel) |
void |
setType(Class<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)
|
com.mongodb.DBObject |
toQueryObject()
create a db object from this query and all of it's child nodes
|
Query<T> |
where(String wh)
set the where string for this query - where-String needs to be valid java script!
|
public QueryImpl(Morphium m, Class<T> type, ObjectMapper map)
public QueryImpl(Morphium m)
public ReadPreferenceLevel getReadPreferenceLevel()
getReadPreferenceLevel in interface Query<T>public void setReadPreferenceLevel(ReadPreferenceLevel readPreferenceLevel)
setReadPreferenceLevel in interface Query<T>public void setType(Class<T> type)
Querypublic 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>public 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 ObjectMapper getMapper()
Querypublic void setMapper(ObjectMapper mapper)
Querypublic void addChild(FilterExpression ex)
Querypublic Query<T> where(String wh)
Querypublic MongoField f(Enum f)
Querypublic MongoField f(String f)
Querypublic void or(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 long countAll()
Querypublic com.mongodb.DBObject toQueryObject()
QuerytoQueryObject in interface Query<T>public Class<T> getType()
Querypublic T getById(org.bson.types.ObjectId id)
Querypublic T get()
Querypublic List<org.bson.types.ObjectId> idList()
Querypublic Query<T> clone() throws CloneNotSupportedException
public Query<T> order(Map<String,Integer> n)
QueryCopyright © 2012. All Rights Reserved.