org.springframework.data.mongodb.repository.support

Class QuerydslAbstractMongodbQuery<K,Q extends QuerydslAbstractMongodbQuery<K,Q>>

  • java.lang.Object
    • org.springframework.data.mongodb.repository.support.QuerydslAbstractMongodbQuery<K,Q>
  • Type Parameters:
    Q - concrete subtype
    All Implemented Interfaces:
    com.querydsl.core.FilteredClause<Q>, com.querydsl.core.SimpleQuery<Q>
    Direct Known Subclasses:
    SpringDataMongodbQuery


    public abstract class QuerydslAbstractMongodbQuery<K,Q extends QuerydslAbstractMongodbQuery<K,Q>>
    extends Object
    implements com.querydsl.core.SimpleQuery<Q>
    QuerydslAbstractMongodbQuery provides a base class for general Querydsl query implementation.

    Original implementation source AbstractMongodbQuery by The Querydsl Team (http://www.querydsl.com/team) licensed under the Apache License, Version 2.0.

    Modified for usage with MongodbDocumentSerializer.
    Since:
    2.1
    Author:
    laimw, Mark Paluch, Christoph Strobl
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      protected org.bson.Document createProjection(com.querydsl.core.types.Expression<?> projectionExpression)
      Compute the actual projection Document from a given projectionExpression by serializing the contained expressions individually.
      protected org.bson.Document createQuery(com.querydsl.core.types.Predicate predicate)
      Compute the filer Document from the given Predicate.
      protected org.bson.Document createSort(List<com.querydsl.core.types.OrderSpecifier<?>> orderSpecifiers)
      Compute the sort Document from the given list of order specifiers.
      Q distinct() 
      Q limit(long limit) 
      Q offset(long offset) 
      Q orderBy(com.querydsl.core.types.OrderSpecifier<?>... o) 
      Q restrict(com.querydsl.core.QueryModifiers modifiers) 
      <T> Q set(com.querydsl.core.types.ParamExpression<T> param, T value) 
      String toString() 
      Q where(com.querydsl.core.types.Predicate... e) 
    • Method Detail

      • where

        public Q where(com.querydsl.core.types.Predicate... e)
        Specified by:
        where in interface com.querydsl.core.FilteredClause<Q extends QuerydslAbstractMongodbQuery<K,Q>>
      • restrict

        public Q restrict(com.querydsl.core.QueryModifiers modifiers)
        Specified by:
        restrict in interface com.querydsl.core.SimpleQuery<Q extends QuerydslAbstractMongodbQuery<K,Q>>
      • orderBy

        public Q orderBy(com.querydsl.core.types.OrderSpecifier<?>... o)
        Specified by:
        orderBy in interface com.querydsl.core.SimpleQuery<Q extends QuerydslAbstractMongodbQuery<K,Q>>
      • set

        public <T> Q set(com.querydsl.core.types.ParamExpression<T> param,
                         T value)
        Specified by:
        set in interface com.querydsl.core.SimpleQuery<Q extends QuerydslAbstractMongodbQuery<K,Q>>
      • createProjection

        protected org.bson.Document createProjection(@Nullable
                                                     com.querydsl.core.types.Expression<?> projectionExpression)
        Compute the actual projection Document from a given projectionExpression by serializing the contained expressions individually.
        Parameters:
        projectionExpression - the computed projection Document.
        Returns:
        never null. An empty Document by default.
        See Also:
        MongodbDocumentSerializer.handle(Expression)
      • createQuery

        protected org.bson.Document createQuery(@Nullable
                                                com.querydsl.core.types.Predicate predicate)
        Compute the filer Document from the given Predicate.
        Parameters:
        predicate - can be null.
        Returns:
        an empty Document if predicate is null.
        See Also:
        MongodbDocumentSerializer.toQuery(Predicate)
      • createSort

        protected org.bson.Document createSort(List<com.querydsl.core.types.OrderSpecifier<?>> orderSpecifiers)
        Compute the sort Document from the given list of order specifiers.
        Parameters:
        orderSpecifiers - can be null.
        Returns:
        an empty Document if predicate is null.
        See Also:
        MongodbDocumentSerializer.toSort(List)