Class TQRestriction
java.lang.Object
org.broadleafcommerce.common.util.dao.TQRestriction
Utilized in conjunction with
TypedQueryBuilder
to generate TypedQueries programmatically.- Author:
- Andre Azzolini (apazzolini)
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
protected TQRestriction.Mode
protected String
protected Object
protected List<TQRestriction>
-
Constructor Summary
ConstructorsConstructorDescriptionTQRestriction
(String expression, String operation) Creates a simple restriction.TQRestriction
(String expression, String operation, Object parameter) Creates a simple restriction.TQRestriction
(TQRestriction.Mode joinMode) Creates an empty restriction node with the specified join mode. -
Method Summary
Modifier and TypeMethodDescriptionAdds a child restriction to the restrictions listRecursively generates a query string representation of this restriction along with any child restrictions that this object may have.
-
Field Details
-
expression
-
operation
-
parameter
-
joinMode
-
restrictions
-
-
Constructor Details
-
TQRestriction
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
Creates a simple restriction.- Parameters:
expression
-operation
-parameter
-
-
TQRestriction
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
Adds a child restriction to the restrictions list- Parameters:
r
-- Returns:
- this
-
toQl
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
-