Spring-data-mongodb Criteria类介绍

类 Criteria

  • java.lang.Object
    • org.springframework.data.mongodb.core.query.Criteria
  • 所有已实现的接口:
    CriteriaDefinition
    直接已知子类:
    GridFsCriteria


    public class Criteria
    extends java.lang.Object
    implements CriteriaDefinition
    Central class for creating queries. It follows a fluent API style so that you can easily chain together multiple criteria. Static import of the 'Criteria.where' method will improve readability.
    • 构造器概要

      构造器  
      限定符 构造器和说明
        Criteria() 
      protected Criteria(java.util.List criteriaChain, java.lang.String key) 
        Criteria(java.lang.String key) 
    • 方法概要

      方法  
      限定符和类型 方法和说明
      Criteria all(java.util.Collection o) 
      Criteria all(java.lang.Object... o)
      Creates a criterion using the $all operator
      Criteria and(java.lang.String key)
      Static factory method to create a Criteria using the provided key
      Criteria andOperator(Criteria... criteria)
      Creates an 'and' criteria using the $and operator for all of the provided criteria
      Criteria elemMatch(Criteria c)
      Creates a criterion using the $elemMatch operator
      boolean equals(java.lang.Object obj) 
      Criteria exists(boolean b)
      Creates a criterion using the $exists operator
      DBObject getCriteriaObject() 
      java.lang.String getKey() 
      protected DBObject getSingleCriteriaObject() 
      Criteria gt(java.lang.Object o)
      Creates a criterion using the $gt operator
      Criteria gte(java.lang.Object o)
      Creates a criterion using the $gte operator
      int hashCode() 
      Criteria in(java.util.Collection c)
      Creates a criterion using the $in operator
      Criteria in(java.lang.Object... o)
      Creates a criterion using the $in operator
      Criteria is(java.lang.Object o)
      Creates a criterion using equality
      Criteria lt(java.lang.Object o)
      Creates a criterion using the $lt operator
      Criteria lte(java.lang.Object o)
      Creates a criterion using the $lte operator
      Criteria maxDistance(double maxDistance)
      Creates a geospatical criterion using a $maxDistance operation, for use with $near
      Criteria mod(java.lang.Number value, java.lang.Number remainder)
      Creates a criterion using the $mod operator
      Criteria ne(java.lang.Object o)
      Creates a criterion using the $ne operator
      Criteria near(Point point)
      Creates a geospatial criterion using a $near operation
      Criteria nearSphere(Point point)
      Creates a geospatial criterion using a $nearSphere operation.
      Criteria nin(java.util.Collection o) 
      Criteria nin(java.lang.Object... o)
      Creates a criterion using the $nin operator
      Criteria norOperator(Criteria... criteria)
      Creates a 'nor' criteria using the $nor operator for all of the provided criteria
      Criteria not()
      Creates a criterion using the $not meta operator which affects the clause directly following
      Criteria orOperator(Criteria... criteria)
      Creates an 'or' criteria using the $or operator for all of the provided criteria
      Criteria regex(java.util.regex.Pattern pattern)
      Syntactical sugar for is(Object) making obvious that we create a regex predicate.
      Criteria regex(java.lang.String re)
      Creates a criterion using a $regex
      Criteria regex(java.lang.String re, java.lang.String options)
      Creates a criterion using a $regex and $options
      Criteria size(int s)
      Creates a criterion using the $size operator
      Criteria type(int t)
      Creates a criterion using the $type operator
      static Criteria where(java.lang.String key)
      Static factory method to create a Criteria using the provided key
      Criteria within(Shape shape) 
      Criteria withinSphere(Circle circle)
      Creates a geospatial criterion using a $within $center operation.
      • 从类继承的方法 java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • Criteria

        public Criteria()
      • Criteria

        public Criteria(java.lang.String key)
      • Criteria

        protected Criteria(java.util.List criteriaChain,
                java.lang.String key)
    • 方法详细资料

      • where

        public static Criteria where(java.lang.String key)
        Static factory method to create a Criteria using the provided key
        参数:
        key -
        返回:
      • and

        public Criteria and(java.lang.String key)
        Static factory method to create a Criteria using the provided key
        返回:
      • is

        public Criteria is(java.lang.Object o)
        Creates a criterion using equality
        参数:
        o -
        返回:
      • ne

        public Criteria ne(java.lang.Object o)
        Creates a criterion using the $ne operator
        参数:
        o -
        返回:
      • lt

        public Criteria lt(java.lang.Object o)
        Creates a criterion using the $lt operator
        参数:
        o -
        返回:
      • lte

        public Criteria lte(java.lang.Object o)
        Creates a criterion using the $lte operator
        参数:
        o -
        返回:
      • gt

        public Criteria gt(java.lang.Object o)
        Creates a criterion using the $gt operator
        参数:
        o -
        返回:
      • gte

        public Criteria gte(java.lang.Object o)
        Creates a criterion using the $gte operator
        参数:
        o -
        返回:
      • in

        public Criteria in(java.lang.Object... o)
        Creates a criterion using the $in operator
        参数:
        o - the values to match against
        返回:
      • in

        public Criteria in(java.util.Collection c)
        Creates a criterion using the $in operator
        参数:
        c - the collection containing the values to match against
        返回:
      • nin

        public Criteria nin(java.lang.Object... o)
        Creates a criterion using the $nin operator
        参数:
        o -
        返回:
      • nin

        public Criteria nin(java.util.Collection o)
      • mod

        public Criteria mod(java.lang.Number value,
                   java.lang.Number remainder)
        Creates a criterion using the $mod operator
        参数:
        value -
        remainder -
        返回:
      • all

        public Criteria all(java.lang.Object... o)
        Creates a criterion using the $all operator
        参数:
        o -
        返回:
      • all

        public Criteria all(java.util.Collection o)
      • size

        public Criteria size(int s)
        Creates a criterion using the $size operator
        参数:
        s -
        返回:
      • exists

        public Criteria exists(boolean b)
        Creates a criterion using the $exists operator
        参数:
        b -
        返回:
      • type

        public Criteria type(int t)
        Creates a criterion using the $type operator
        参数:
        t -
        返回:
      • not

        public Criteria not()
        Creates a criterion using the $not meta operator which affects the clause directly following
        返回:
      • regex

        public Criteria regex(java.lang.String re)
        Creates a criterion using a $regex
        参数:
        re -
        返回:
      • regex

        public Criteria regex(java.lang.String re,
                     java.lang.String options)
        Creates a criterion using a $regex and $options
        参数:
        re -
        options -
        返回:
      • regex

        public Criteria regex(java.util.regex.Pattern pattern)
        Syntactical sugar for is(Object) making obvious that we create a regex predicate.
        参数:
        pattern -
        返回:
      • withinSphere

        public Criteria withinSphere(Circle circle)
        Creates a geospatial criterion using a $within $center operation. This is only available for Mongo 1.7 and higher.
        参数:
        circle - must not be null
        返回:
      • within

        public Criteria within(Shape shape)
      • near

        public Criteria near(Point point)
        Creates a geospatial criterion using a $near operation
        参数:
        point - must not be null
        返回:
      • nearSphere

        public Criteria nearSphere(Point point)
        Creates a geospatial criterion using a $nearSphere operation. This is only available for Mongo 1.7 and higher.
        参数:
        point - must not be null
        返回:
      • maxDistance

        public Criteria maxDistance(double maxDistance)
        Creates a geospatical criterion using a $maxDistance operation, for use with $near
        参数:
        maxDistance -
        返回:
      • elemMatch

        public Criteria elemMatch(Criteria c)
        Creates a criterion using the $elemMatch operator
        参数:
        c -
        返回:
      • orOperator

        public Criteria orOperator(Criteria... criteria)
        Creates an 'or' criteria using the $or operator for all of the provided criteria
        参数:
        criteria -
      • norOperator

        public Criteria norOperator(Criteria... criteria)
        Creates a 'nor' criteria using the $nor operator for all of the provided criteria
        参数:
        criteria -
      • andOperator

        public Criteria andOperator(Criteria... criteria)
        Creates an 'and' criteria using the $and operator for all of the provided criteria
        参数:
        criteria -
      • getKey

        public java.lang.String getKey()
      • getCriteriaObject

        public DBObject getCriteriaObject()
        指定者:
        getCriteriaObject 在接口中  CriteriaDefinition
      • getSingleCriteriaObject

        protected DBObject getSingleCriteriaObject()
      • equals

        public boolean equals(java.lang.Object obj)
        覆盖:
        equals 在类中  java.lang.Object
      • hashCode

        public int hashCode()
        覆盖:
        hashCode 在类中  java.lang.Object

你可能感兴趣的:(MongoDb)