Class SqlQueryTransformer


  • public class SqlQueryTransformer
    extends java.lang.Object
    Rewrite SQL queries to reverse the effects of @ColumnTransformer annotations in WHERE clauses.
    Since:
    5.5.6
    • Constructor Summary

      Constructors 
      Constructor Description
      SqlQueryTransformer()
      Convenience constructor for unit testing so that it need not mock a data source.
      SqlQueryTransformer​(javax.sql.DataSource dataSource)
      Construct a SQL query transformer that parses the SQL dialect appropriate for the given data source.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String transformQuery​(java.lang.String sql)
      Reverse the effects of @ColumnTransformer annotations in WHERE clauses.
      • Methods inherited from class java.lang.Object

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

      • SqlQueryTransformer

        public SqlQueryTransformer()
        Convenience constructor for unit testing so that it need not mock a data source. Not for use in production. May be removed without warning.
      • SqlQueryTransformer

        public SqlQueryTransformer​(javax.sql.DataSource dataSource)
                            throws org.springframework.jdbc.support.MetaDataAccessException
        Construct a SQL query transformer that parses the SQL dialect appropriate for the given data source.
        Parameters:
        dataSource - a data source
        Throws:
        org.springframework.jdbc.support.MetaDataAccessException - if the metadata about the database could not be accessed from the data source
    • Method Detail

      • transformQuery

        public java.lang.String transformQuery​(java.lang.String sql)
        Reverse the effects of @ColumnTransformer annotations in WHERE clauses.
        Parameters:
        sql - a SQL query
        Returns:
        the transformed query