Class TQRestriction

java.lang.Object
org.broadleafcommerce.common.util.dao.TQRestriction

public class TQRestriction extends Object
Utilized in conjunction with TypedQueryBuilder to generate TypedQueries programmatically.
Author:
Andre Azzolini (apazzolini)
  • Field Details

  • Constructor Details

    • TQRestriction

      public TQRestriction(String expression, String operation)
      Creates a simple restriction. As there is no value associated, it is expected that the operation does not require a parameter value, such as IS NULL.
      Parameters:
      expression -
      operation -
    • TQRestriction

      public TQRestriction(String expression, String operation, Object parameter)
      Creates a simple restriction.
      Parameters:
      expression -
      operation -
      parameter -
    • TQRestriction

      public TQRestriction(TQRestriction.Mode joinMode)
      Creates an empty restriction node with the specified join mode. It is expected that this restriction would then have at least 2 items in the restrictions list.
      Parameters:
      joinMode -
  • Method Details

    • addChildRestriction

      public TQRestriction addChildRestriction(TQRestriction r)
      Adds a child restriction to the restrictions list
      Parameters:
      r -
      Returns:
      this
    • toQl

      public String toQl(String parameterName, Map<String,Object> paramMap)
      Recursively generates a query string representation of this restriction along with any child restrictions that this object may have.

      It will also populate the paramMap for the appropriate values as it's iterating through the restrictions.

      Parameters:
      parameterName -
      paramMap -
      Returns:
      the query language string