public abstract class BsonQuery extends org.grails.datastore.mapping.query.Query
A base class for Query implementations that create BSON queries based on MongoDB query format. See https://docs.mongodb.com/manual/tutorial/query-documents/
Modifiers | Name | Description |
---|---|---|
protected interface |
BsonQuery.OperatorHandler |
Handles query operators when reading BSON |
protected interface |
BsonQuery.ProjectionHandler |
Handles a projection |
protected interface |
BsonQuery.QueryHandler |
Handles an individual criterion |
Modifiers | Name | Description |
---|---|---|
static java.lang.String |
AND_OPERATOR |
|
static java.lang.String |
AVERAGE_OPERATOR |
|
static org.bson.codecs.EncoderContext |
ENCODER_CONTEXT |
|
static java.lang.String |
EQ_OPERATOR |
|
static java.lang.String |
EXISTS_OPERATOR |
|
static java.lang.String |
GROUP_OPERATOR |
|
static java.lang.String |
GTE_OPERATOR |
|
static java.lang.String |
GT_OPERATOR |
|
static java.lang.String |
ID_REFERENCE_SUFFIX |
|
static java.lang.String |
IN_OPERATOR |
|
static java.lang.String |
LTE_OPERATOR |
|
static java.lang.String |
LT_OPERATOR |
|
static java.lang.String |
MATCH_OPERATOR |
|
static java.lang.String |
MAX_OPERATOR |
|
static java.lang.String |
MIN_OPERATOR |
|
static java.lang.String |
NE_OPERATOR |
|
static java.lang.String |
NIN_OPERATOR |
|
static java.lang.String |
NOR_OPERATOR |
|
static java.lang.String |
NOT_OPERATOR |
|
static java.lang.String |
OR_OPERATOR |
|
static java.lang.String |
PROJECT_OPERATOR |
|
static java.lang.String |
REGEX_OPERATOR |
|
static java.lang.String |
SIZE_OPERATOR |
|
static java.lang.String |
SORT_OPERATOR |
|
static java.lang.String |
SUM_OPERATOR |
|
static java.lang.String |
WHERE_OPERATOR |
|
protected static java.util.Map<java.lang.Class, ProjectionHandler> |
groupByProjectionHandlers |
|
protected static java.util.Map<java.lang.String, OperatorHandler> |
operatorHandlers |
|
protected static java.util.Map<java.lang.Class, ProjectionHandler> |
projectProjectionHandlers |
|
protected static java.util.Map<java.lang.Class, QueryHandler> |
queryHandlers |
Type Params | Return Type | Name and description |
---|---|---|
|
public static org.bson.Document |
createBsonQuery(org.bson.codecs.configuration.CodecRegistry registry, org.grails.datastore.mapping.model.PersistentEntity entity, java.util.List<Criterion> criteria) Creates a new query for the given registry, entity and criteria |
|
public static org.bson.Document |
createBsonQuery(org.bson.codecs.configuration.CodecRegistry registry, org.grails.datastore.mapping.model.PersistentEntity entity, Junction junction) Creates a new query for the given registry, entity and criteria |
|
protected static java.util.List<java.lang.Object> |
getInListQueryValues(org.grails.datastore.mapping.model.PersistentEntity entity, In in) Get the list of native values to use in the query. |
|
protected static org.bson.Document |
getOrCreatePropertyQuery(org.bson.Document query, java.lang.String propertyName) |
|
protected static java.lang.String |
getPropertyName(org.grails.datastore.mapping.model.PersistentEntity entity, PropertyNameCriterion criterion) |
|
protected static java.lang.String |
getPropertyName(org.grails.datastore.mapping.model.PersistentEntity entity, java.lang.String propertyName) |
|
public void |
handle(EmbeddedQueryEncoder queryEncoder, IdEquals criterion, org.bson.Document query, org.grails.datastore.mapping.model.PersistentEntity entity) |
|
public void |
handle(EmbeddedQueryEncoder queryEncoder, Equals criterion, org.bson.Document query, org.grails.datastore.mapping.model.PersistentEntity entity) |
|
public void |
handle(EmbeddedQueryEncoder queryEncoder, IsNull criterion, org.bson.Document query, org.grails.datastore.mapping.model.PersistentEntity entity) |
|
public void |
handle(EmbeddedQueryEncoder queryEncoder, IsNotNull criterion, org.bson.Document query, org.grails.datastore.mapping.model.PersistentEntity entity) |
|
public void |
handle(EmbeddedQueryEncoder queryEncoder, EqualsProperty criterion, org.bson.Document query, org.grails.datastore.mapping.model.PersistentEntity entity) |
|
public void |
handle(EmbeddedQueryEncoder queryEncoder, NotEqualsProperty criterion, org.bson.Document query, org.grails.datastore.mapping.model.PersistentEntity entity) |
|
public void |
handle(EmbeddedQueryEncoder queryEncoder, GreaterThanProperty criterion, org.bson.Document query, org.grails.datastore.mapping.model.PersistentEntity entity) |
|
public void |
handle(EmbeddedQueryEncoder queryEncoder, LessThanProperty criterion, org.bson.Document query, org.grails.datastore.mapping.model.PersistentEntity entity) |
|
public void |
handle(EmbeddedQueryEncoder queryEncoder, GreaterThanEqualsProperty criterion, org.bson.Document query, org.grails.datastore.mapping.model.PersistentEntity entity) |
|
public void |
handle(EmbeddedQueryEncoder queryEncoder, LessThanEqualsProperty criterion, org.bson.Document query, org.grails.datastore.mapping.model.PersistentEntity entity) |
|
public void |
handle(EmbeddedQueryEncoder queryEncoder, NotEquals criterion, org.bson.Document query, org.grails.datastore.mapping.model.PersistentEntity entity) |
|
public void |
handle(EmbeddedQueryEncoder queryEncoder, Like like, org.bson.Document query, org.grails.datastore.mapping.model.PersistentEntity entity) |
|
public void |
handle(EmbeddedQueryEncoder queryEncoder, ILike like, org.bson.Document query, org.grails.datastore.mapping.model.PersistentEntity entity) |
|
public void |
handle(EmbeddedQueryEncoder queryEncoder, RLike like, org.bson.Document query, org.grails.datastore.mapping.model.PersistentEntity entity) |
|
public void |
handle(EmbeddedQueryEncoder queryEncoder, In in, org.bson.Document query, org.grails.datastore.mapping.model.PersistentEntity entity) |
|
public void |
handle(EmbeddedQueryEncoder queryEncoder, Between between, org.bson.Document query, org.grails.datastore.mapping.model.PersistentEntity entity) |
|
public void |
handle(EmbeddedQueryEncoder queryEncoder, GreaterThan criterion, org.bson.Document query, org.grails.datastore.mapping.model.PersistentEntity entity) |
|
public void |
handle(EmbeddedQueryEncoder queryEncoder, GreaterThanEquals criterion, org.bson.Document query, org.grails.datastore.mapping.model.PersistentEntity entity) |
|
public void |
handle(EmbeddedQueryEncoder queryEncoder, LessThan criterion, org.bson.Document query, org.grails.datastore.mapping.model.PersistentEntity entity) |
|
public void |
handle(EmbeddedQueryEncoder queryEncoder, LessThanEquals criterion, org.bson.Document query, org.grails.datastore.mapping.model.PersistentEntity entity) |
|
public void |
handle(EmbeddedQueryEncoder queryEncoder, Conjunction criterion, org.bson.Document query, org.grails.datastore.mapping.model.PersistentEntity entity) |
|
public void |
handle(EmbeddedQueryEncoder queryEncoder, Negation criteria, org.bson.Document query, org.grails.datastore.mapping.model.PersistentEntity entity) |
|
public void |
handle(EmbeddedQueryEncoder queryEncoder, Disjunction criterion, org.bson.Document query, org.grails.datastore.mapping.model.PersistentEntity entity) |
|
public void |
handle(EmbeddedQueryEncoder queryEncoder, SizeEquals criterion, org.bson.Document query, org.grails.datastore.mapping.model.PersistentEntity entity) |
|
public void |
handle(EmbeddedQueryEncoder queryEncoder, SizeNotEquals criterion, org.bson.Document query, org.grails.datastore.mapping.model.PersistentEntity entity) |
|
public void |
handle(EmbeddedQueryEncoder queryEncoder, SizeGreaterThan criterion, org.bson.Document query, org.grails.datastore.mapping.model.PersistentEntity entity) |
|
public void |
handle(EmbeddedQueryEncoder queryEncoder, SizeLessThan criterion, org.bson.Document query, org.grails.datastore.mapping.model.PersistentEntity entity) |
|
public void |
handle(EmbeddedQueryEncoder queryEncoder, SizeLessThanEquals criterion, org.bson.Document query, org.grails.datastore.mapping.model.PersistentEntity entity) |
|
public void |
handle(EmbeddedQueryEncoder queryEncoder, SizeGreaterThanEquals criterion, org.bson.Document query, org.grails.datastore.mapping.model.PersistentEntity entity) |
|
public void |
handle(Junction criteria, java.lang.String attributeName, org.bson.BsonReader queryReader) |
|
public void |
handle(Junction criteria, java.lang.String attributeName, org.bson.BsonReader queryReader) |
|
public void |
handle(Junction criteria, java.lang.String attributeName, org.bson.BsonReader queryReader) |
|
public void |
handle(Junction criteria, java.lang.String attributeName, org.bson.BsonReader queryReader) |
|
public void |
handle(Junction criteria, java.lang.String attributeName, org.bson.BsonReader queryReader) |
|
public void |
handle(Junction criteria, java.lang.String attributeName, org.bson.BsonReader queryReader) |
|
public void |
handle(Junction criteria, java.lang.String attributeName, org.bson.BsonReader queryReader) |
|
public void |
handle(Junction criteria, java.lang.String attributeName, org.bson.BsonReader queryReader) |
|
public void |
handle(Junction criteria, java.lang.String attributeName, org.bson.BsonReader queryReader) |
|
public void |
handle(Junction criteria, java.lang.String attributeName, org.bson.BsonReader queryReader) |
|
public void |
handle(Junction criteria, java.lang.String attributeName, org.bson.BsonReader queryReader) |
|
public void |
handle(Junction criteria, java.lang.String attributeName, org.bson.BsonReader queryReader) |
<T> |
public static grails.gorm.DetachedCriteria<T> |
parse(java.lang.Class<T> type, org.bson.BsonReader queryReader) Parse a query from a BsonReader into a DetachedCriteria |
|
protected static void |
populateBsonQuery(EmbeddedQueryEncoder queryEncoder, org.bson.Document query, java.util.List<Criterion> criteria, org.grails.datastore.mapping.model.PersistentEntity entity) |
|
protected static void |
populateBsonQuery(EmbeddedQueryEncoder queryEncoder, org.bson.Document query, Junction criteria, org.grails.datastore.mapping.model.PersistentEntity entity) |
|
protected static java.lang.Object |
readBsonValue(org.bson.BsonReader queryReader, org.bson.BsonType bsonType) |
Methods inherited from class | Name |
---|---|
class org.grails.datastore.mapping.query.Query |
org.grails.datastore.mapping.query.Query#isNotEmpty(java.lang.String), org.grails.datastore.mapping.query.Query#conjunction(), org.grails.datastore.mapping.query.Query#gt(java.lang.String, java.lang.Object), org.grails.datastore.mapping.query.Query#projections(), org.grails.datastore.mapping.query.Query#getSession(), org.grails.datastore.mapping.query.Query#getEntity(), org.grails.datastore.mapping.query.Query#rlike(java.lang.String, java.lang.String), org.grails.datastore.mapping.query.Query#getCriteria(), org.grails.datastore.mapping.query.Query#select(java.lang.String), org.grails.datastore.mapping.query.Query#maxResults(int), org.grails.datastore.mapping.query.Query#firstResult(int), org.grails.datastore.mapping.query.Query#getOrderBy(), org.grails.datastore.mapping.query.Query#singleResult(), org.grails.datastore.mapping.query.Query#setUniqueResult(boolean), org.grails.datastore.mapping.query.Query#patternToRegex(java.lang.Object), org.grails.datastore.mapping.query.Query#disjunction(), org.grails.datastore.mapping.query.Query#negation(), org.grails.datastore.mapping.query.Query#ge(java.lang.String, java.lang.Object), org.grails.datastore.mapping.query.Query#like(java.lang.String, java.lang.String), org.grails.datastore.mapping.query.Query#isNotNull(java.lang.String), org.grails.datastore.mapping.query.Query#ilike(java.lang.String, java.lang.String), org.grails.datastore.mapping.query.Query#allEq(java.util.Map), org.grails.datastore.mapping.query.Query#idEq(java.lang.Object), org.grails.datastore.mapping.query.Query#gte(java.lang.String, java.lang.Object), org.grails.datastore.mapping.query.Query#lte(java.lang.String, java.lang.Object), org.grails.datastore.mapping.query.Query#createQuery(java.lang.String), org.grails.datastore.mapping.query.Query#add(org.grails.datastore.mapping.query.Query$Junction, org.grails.datastore.mapping.query.Query$Criterion), org.grails.datastore.mapping.query.Query#add(org.grails.datastore.mapping.query.Query$Criterion), org.grails.datastore.mapping.query.Query#lock(boolean), org.grails.datastore.mapping.query.Query#lock(jakarta.persistence.LockModeType), org.grails.datastore.mapping.query.Query#cache(boolean), org.grails.datastore.mapping.query.Query#clone(), org.grails.datastore.mapping.query.Query#max(int), org.grails.datastore.mapping.query.Query#isEmpty(java.lang.String), org.grails.datastore.mapping.query.Query#join(java.lang.String, jakarta.persistence.criteria.JoinType), org.grails.datastore.mapping.query.Query#join(java.lang.String), org.grails.datastore.mapping.query.Query#offset(int), org.grails.datastore.mapping.query.Query#list(), org.grails.datastore.mapping.query.Query#in(java.lang.String, java.util.List), org.grails.datastore.mapping.query.Query#le(java.lang.String, java.lang.Object), org.grails.datastore.mapping.query.Query#eq(java.lang.String, java.lang.Object), org.grails.datastore.mapping.query.Query#isNull(java.lang.String), org.grails.datastore.mapping.query.Query#order(org.grails.datastore.mapping.query.Query$Order), org.grails.datastore.mapping.query.Query#lt(java.lang.String, java.lang.Object), org.grails.datastore.mapping.query.Query#or(org.grails.datastore.mapping.query.Query$Criterion, org.grails.datastore.mapping.query.Query$Criterion), org.grails.datastore.mapping.query.Query#between(java.lang.String, java.lang.Object, java.lang.Object), org.grails.datastore.mapping.query.Query#and(org.grails.datastore.mapping.query.Query$Criterion, org.grails.datastore.mapping.query.Query$Criterion), org.grails.datastore.mapping.query.Query#wait(long, int), org.grails.datastore.mapping.query.Query#wait(), org.grails.datastore.mapping.query.Query#wait(long), org.grails.datastore.mapping.query.Query#equals(java.lang.Object), org.grails.datastore.mapping.query.Query#toString(), org.grails.datastore.mapping.query.Query#hashCode(), org.grails.datastore.mapping.query.Query#getClass(), org.grails.datastore.mapping.query.Query#notify(), org.grails.datastore.mapping.query.Query#notifyAll() |
Creates a new query for the given registry, entity and criteria
registry
- The registryentity
- The entitycriteria
- The criteriaCreates a new query for the given registry, entity and criteria
registry
- The registryentity
- The entityjunction
- The junctionGet the list of native values to use in the query. This converts entities to ids and other types to their persisted types.
entity
- The entityin
- The criterionParse a query from a BsonReader into a DetachedCriteria
type
- The entity typequeryReader
- The query readerT
- The entity concrete type