java.lang.Object
org.springframework.data.jdbc.core.convert.QueryMapper

public class QueryMapper extends Object
Maps CriteriaDefinition and Sort objects considering mapping metadata and dialect-specific conversion.
Since:
3.0
Author:
Mark Paluch, Jens Schauder, Yan Qiang, Mikhail Fedorov
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    protected static class 
    Value object to represent a field and its meta-information.
    protected static class 
    Extension of QueryMapper.Field to be backed with mapping metadata.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new QueryMapper with the given JdbcConverter.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected Object
    convertValue(Object value, TypeInformation<?> typeInformation)
     
    org.springframework.data.relational.core.sql.Condition
    getMappedObject(MapSqlParameterSource parameterSource, org.springframework.data.relational.core.query.CriteriaDefinition criteria, org.springframework.data.relational.core.sql.Table table, org.springframework.data.relational.core.mapping.RelationalPersistentEntity<?> entity)
    Map a CriteriaDefinition object into Condition and consider value/NULL bindings.
    List<org.springframework.data.relational.core.sql.OrderByField>
    getMappedSort(org.springframework.data.relational.core.sql.Table table, Sort sort, org.springframework.data.relational.core.mapping.RelationalPersistentEntity<?> entity)
    Map the Sort object to apply field name mapping using the type to read.
    protected MappingContext<? extends org.springframework.data.relational.core.mapping.RelationalPersistentEntity<?>,org.springframework.data.relational.core.mapping.RelationalPersistentProperty>
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • getMappedSort

      public List<org.springframework.data.relational.core.sql.OrderByField> getMappedSort(org.springframework.data.relational.core.sql.Table table, Sort sort, @Nullable org.springframework.data.relational.core.mapping.RelationalPersistentEntity<?> entity)
      Map the Sort object to apply field name mapping using the type to read.
      Parameters:
      sort - must not be null.
      entity - related RelationalPersistentEntity, can be null.
      Returns:
      a List of OrderByField objects guaranteed to be not null.
    • getMappedObject

      public org.springframework.data.relational.core.sql.Condition getMappedObject(MapSqlParameterSource parameterSource, org.springframework.data.relational.core.query.CriteriaDefinition criteria, org.springframework.data.relational.core.sql.Table table, @Nullable org.springframework.data.relational.core.mapping.RelationalPersistentEntity<?> entity)
      Map a CriteriaDefinition object into Condition and consider value/NULL bindings.
      Parameters:
      parameterSource - bind parameterSource object, must not be null.
      criteria - criteria definition to map, must not be null.
      table - must not be null.
      entity - related RelationalPersistentEntity, can be null.
      Returns:
      the mapped Condition.
    • convertValue

      @Nullable protected Object convertValue(@Nullable Object value, TypeInformation<?> typeInformation)
    • getMappingContext

      protected MappingContext<? extends org.springframework.data.relational.core.mapping.RelationalPersistentEntity<?>,org.springframework.data.relational.core.mapping.RelationalPersistentProperty> getMappingContext()