Interface ColumnResolver

All Known Implementing Classes:
SqlBeanQueryContext
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

Maps a logical column name to its dialect-quoted SQL reference, for SqlSearchCompiler.

Only columns that passed validation reach it: column types and operator sets travel in the ResolvedQuery, so a resolver never has to guess about an unknown name. SqlBeanQueryContext is the usual implementation. The interface is small so the compiler can be tested without a context or a database.

Example:

// Logical names map one-to-one to quoted SQL names. ColumnResolver columns = c -> dialect.quote(c); SqlFragment where = SqlSearchCompiler.create(dialect, columns).compile(context.resolve(query).filter());

Since:
10.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    columnSql(String column)
    Returns the dialect-quoted SQL reference for a column (for example "age" for column age).
  • Method Details

    • columnSql

      Returns the dialect-quoted SQL reference for a column (for example "age" for column age).
      Parameters:
      column - A validated logical column name. Never null.
      Returns:
      The quoted SQL reference.