java.lang.Object
org.springframework.data.mongodb.repository.query.QueryUtils

public class QueryUtils extends Object
Internal utility class to help avoid duplicate code required in both the reactive and the sync Query support offered by repositories.
Since:
2.1
Author:
Christoph Strobl, Mark Paluch
  • Field Details

    • LOGGER

      protected static final Log LOGGER
  • Constructor Details

    • QueryUtils

      public QueryUtils()
  • Method Details

    • decorateSort

      public static Query decorateSort(Query query, org.bson.Document defaultSort)
      Decorate Query and add a default sort expression to the given Query. Attributes of the given sort may be overwritten by the sort explicitly defined by the Query itself.
      Parameters:
      query - the Query to decorate.
      defaultSort - the default sort expression to apply to the query.
      Returns:
      the query having the given sort applied.
    • queryProxyType

      public static Class<?> queryProxyType(Class<? extends Query> baseType, ClassLoader classLoader)
      Decorate Query and add a default sort expression to the given Query. Attributes of the given sort may be overwritten by the sort explicitly defined by the Query itself.
      Parameters:
      classLoader - the ClassLoader to use for generating the proxy type with.