Class MongoDBAbstractQueryBuilder
java.lang.Object
org.nuxeo.ecm.core.storage.mongodb.MongoDBAbstractQueryBuilder
- Direct Known Subclasses:
MongoDBRepositoryQueryBuilder
,MongoDBSession.MongoDBDirectoryQueryBuilder
Abstract query builder for a MongoDB query from an
Expression
.
Must be customized by defining an implementation for the walkReference(String)
method.
- Since:
- 5.9.4
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected final MongoDBConverter
protected static final String
protected String
Prefix to remove for $elemMatch (including final dot), ornull
if there's no current prefix to remove.protected final Expression
protected static final String
protected boolean
static final Long
static final Long
static final Double
static final Double
protected org.bson.Document
protected static final Pattern
-
Constructor Summary
ConstructorDescriptionMongoDBAbstractQueryBuilder
(MongoDBConverter converter, Expression expression) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkDateLiteralForCast
(Operand value, String name) protected void
checkDateLiteralForCast
(Operator op, Operand value, String name) protected String
getMongoDBPrefix
(String prefix) Computes the MongoDB prefix from the DBS common prefix.org.bson.Document
getQuery()
protected org.bson.Document
newDocumentWithField
(MongoDBAbstractQueryBuilder.FieldInfo fieldInfo, Object value) protected Object
pushDownNot
(Object object) protected String
stripElemMatchPrefix
(String field) void
walk()
org.bson.Document
walkAndOr
(Expression expr) protected org.bson.Document
walkAndOr
(Expression expr, List<? extends Operand> values) org.bson.Document
org.bson.Document
walkBetween
(Operand lvalue, Operand rvalue, boolean positive) walkBooleanLiteral
(MongoDBAbstractQueryBuilder.FieldInfo fieldInfo, BooleanLiteral lit) walkDateLiteral
(MongoDBAbstractQueryBuilder.FieldInfo fieldInfo, DateLiteral lit) walkDoubleLiteral
(MongoDBAbstractQueryBuilder.FieldInfo fieldInfo, DoubleLiteral lit) org.bson.Document
org.bson.Document
walkEq
(MongoDBAbstractQueryBuilder.FieldInfo fieldInfo, Operand rvalue) org.bson.Document
walkExpression
(Expression expr) walkFunction
(Function func) org.bson.Document
org.bson.Document
org.bson.Document
org.bson.Document
walkIn
(MongoDBAbstractQueryBuilder.FieldInfo fieldInfo, Operand rvalue, boolean positive) walkIntegerLiteral
(MongoDBAbstractQueryBuilder.FieldInfo fieldInfo, IntegerLiteral lit) org.bson.Document
walkIsNotNull
(Operand value) org.bson.Document
walkIsNull
(Operand value) org.bson.Document
walkLiteral
(MongoDBAbstractQueryBuilder.FieldInfo fieldInfo, Literal lit) walkLiteralList
(MongoDBAbstractQueryBuilder.FieldInfo fieldInfo, LiteralList litList) org.bson.Document
org.bson.Document
org.bson.Document
org.bson.Document
org.bson.Document
walkNotEq
(MongoDBAbstractQueryBuilder.FieldInfo fieldInfo, Operand rvalue) walkOperand
(MongoDBAbstractQueryBuilder.FieldInfo fieldInfo, Operand op) walkOperandList
(List<? extends Operand> values) protected abstract MongoDBAbstractQueryBuilder.FieldInfo
walkReference
(String name) Walks a reference, and returns field info about it.protected MongoDBAbstractQueryBuilder.FieldInfo
walkReference
(Operand value) walkReference
(Reference ref) Returns the MongoDB field for this reference.walkStringLiteral
(MongoDBAbstractQueryBuilder.FieldInfo fieldInfo, StringLiteral lit)
-
Field Details
-
LONG_ZERO
-
LONG_ONE
-
ONE
-
MINUS_ONE
-
DATE_CAST
- See Also:
-
LIKE_ANCHORED_PROP
- See Also:
-
converter
-
expression
-
query
protected org.bson.Document query -
elemMatchPrefix
Prefix to remove for $elemMatch (including final dot), ornull
if there's no current prefix to remove. -
likeAnchored
protected boolean likeAnchored -
SLASH_WILDCARD_SLASH
-
-
Constructor Details
-
MongoDBAbstractQueryBuilder
-
-
Method Details
-
walk
public void walk() -
getQuery
public org.bson.Document getQuery() -
walkExpression
-
checkDateLiteralForCast
-
checkDateLiteralForCast
-
walkNot
-
pushDownNot
-
newDocumentWithField
protected org.bson.Document newDocumentWithField(MongoDBAbstractQueryBuilder.FieldInfo fieldInfo, Object value) -
walkIsNull
-
walkIsNotNull
-
walkAndOrMultiExpression
-
walkAndOr
-
walkAndOr
-
getMongoDBPrefix
Computes the MongoDB prefix from the DBS common prefix.foo/bar/*1 -> foo.bar. ecm:acp/*1/acl/*1 -> ecm:acp.acl.
-
stripElemMatchPrefix
-
walkEq
-
walkEq
-
walkNotEq
-
walkNotEq
-
walkLt
-
walkGt
-
walkLtEq
-
walkGtEq
-
walkBetween
-
walkIn
-
walkIn
public org.bson.Document walkIn(MongoDBAbstractQueryBuilder.FieldInfo fieldInfo, Operand rvalue, boolean positive) -
walkLike
-
walkOperand
-
walkLiteral
-
walkBooleanLiteral
public Object walkBooleanLiteral(MongoDBAbstractQueryBuilder.FieldInfo fieldInfo, BooleanLiteral lit) -
walkDateLiteral
-
walkDoubleLiteral
-
walkIntegerLiteral
public Object walkIntegerLiteral(MongoDBAbstractQueryBuilder.FieldInfo fieldInfo, IntegerLiteral lit) -
walkStringLiteral
-
walkLiteralList
public List<Object> walkLiteralList(MongoDBAbstractQueryBuilder.FieldInfo fieldInfo, LiteralList litList) -
walkOperandList
-
walkFunction
-
walkReference
-
walkReference
Returns the MongoDB field for this reference. -
walkReference
Walks a reference, and returns field info about it.
-