Class MongoQueryCreator
java.lang.Object
org.springframework.data.repository.query.parser.AbstractQueryCreator<Query,Criteria>
org.springframework.data.mongodb.repository.query.MongoQueryCreator
Custom query creator to create Mongo criterias.
- Author:
- Oliver Gierke, Thomas Darimont, Christoph Strobl, Edward Prentice
-
Constructor Summary
ConstructorsConstructorDescriptionMongoQueryCreator(PartTree tree, MongoParameterAccessor accessor, MappingContext<?, MongoPersistentProperty> context) Creates a newMongoQueryCreatorfrom the givenPartTree,ConvertingParameterAccessorandMappingContext.MongoQueryCreator(PartTree tree, MongoParameterAccessor accessor, MappingContext<?, MongoPersistentProperty> context, boolean isGeoNearQuery, boolean isSearchQuery) Creates a newMongoQueryCreatorfrom the givenPartTree,ConvertingParameterAccessorandMappingContext. -
Method Summary
Modifier and TypeMethodDescriptionprotected Criteriaprotected Queryprotected Criteriaprotected CriteriacreateContainingCriteria(Part part, MongoPersistentProperty property, Criteria criteria, Object parameter) If the target property of the comparison is of type String, then the operator checks for match using regular expression.protected Criteriaprotected Criteriaprotected Criteriaprotected Criteriaprotected CriteriaMethods inherited from class AbstractQueryCreator
createQuery, createQuery
-
Constructor Details
-
MongoQueryCreator
public MongoQueryCreator(PartTree tree, MongoParameterAccessor accessor, MappingContext<?, MongoPersistentProperty> context) Creates a newMongoQueryCreatorfrom the givenPartTree,ConvertingParameterAccessorandMappingContext.- Parameters:
tree-accessor-context-
-
MongoQueryCreator
public MongoQueryCreator(PartTree tree, MongoParameterAccessor accessor, MappingContext<?, MongoPersistentProperty> context, boolean isGeoNearQuery, boolean isSearchQuery) Creates a newMongoQueryCreatorfrom the givenPartTree,ConvertingParameterAccessorandMappingContext.- Parameters:
tree-accessor-context-isGeoNearQuery-isSearchQuery-
-
-
Method Details
-
create
-
and
-
or
-
complete
-
in
-
nin
-
regex
-
exists
-
createContainingCriteria
protected Criteria createContainingCriteria(Part part, MongoPersistentProperty property, Criteria criteria, Object parameter) If the target property of the comparison is of type String, then the operator checks for match using regular expression. If the target property of the comparison is aCollectionthen the operator evaluates to true if it finds an exact match within any member of theCollection.- Parameters:
part-property-criteria-parameter-- Returns:
-