Class HQLQueryStrategy


  • public class HQLQueryStrategy
    extends QueryStrategy
    The HQLQueryStrategy to build HQL queries by parsing SQL like query statements. This strategy looks for name-value-pairs connected with '=' or ' like '. Multiple name-value-pairs connected with 'and' or 'or' are supported.
    Author:
    sts
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String buildHQLQuery​(java.util.Properties templateProperties, java.lang.String ddc, java.lang.String query)
      Builds a HQL query out of the given parameters.
      boolean isSpecialQuery​(java.lang.String query)
      Searches for '=' and ' like ' in the given query string.
      • Methods inherited from class java.lang.Object

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

      • HQLQueryStrategy

        public HQLQueryStrategy()
    • Method Detail

      • isSpecialQuery

        public boolean isSpecialQuery​(java.lang.String query)
        Searches for '=' and ' like ' in the given query string.
        Specified by:
        isSpecialQuery in class QueryStrategy
        Parameters:
        query - The user query to be mapped to HQL.
        Returns:
        true if '=' or ' like ' is contained in the given query.
      • buildHQLQuery

        public java.lang.String buildHQLQuery​(java.util.Properties templateProperties,
                                              java.lang.String ddc,
                                              java.lang.String query)
        Builds a HQL query out of the given parameters. This strategy looks for name-value-pairs connected with '=' or ' like '. Multiple name-value-pairs connected with 'and' or 'or' are supported.
        Specified by:
        buildHQLQuery in class QueryStrategy
        Parameters:
        templateProperties - The properties to be used to build the HQL query.
        ddc - The DDC to be used to build the HQL query.
        query - The user query to be mapped to HQL.
        Returns:
        The built HQL query.