java.lang.Object
org.refcodes.criteria.ExpressionQueryFactory
- All Implemented Interfaces:
QueryFactory<String>
The
ExpressionCriteriaFactory
is capable of
creating query String
instances from
Criteria
instances; the query
String
instances which can be used as parts of SQL
statements.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfromCriteria
(Criteria aCriteria) Generates a query from the providedCriteria
(tree).toQuery
(IntersectWithCriteria aCriteriaNode, boolean isCriteriaTreeRoot) Generates a query string for the givenCriteriaNode
.toQuery
(LessThanCriteria<?> aCriteriaLeaf, boolean isCriteriaTreeRoot) Generates a query string for the givenCriteriaLeaf
.
-
Constructor Details
-
ExpressionQueryFactory
public ExpressionQueryFactory()
-
-
Method Details
-
fromCriteria
Generates a query from the providedCriteria
(tree).- Specified by:
fromCriteria
in interfaceQueryFactory<String>
- Parameters:
aCriteria
- TheCriteria
from which to generate the query.- Returns:
- A query generated from the provided
Criteria
(tree).
-
toQuery
Generates a query string for the givenCriteriaNode
.- Parameters:
aCriteriaNode
- TheCriteriaNode
for which to generate the query.isCriteriaTreeRoot
- True in case theCriteriaNode
is the root of theCriteria
tree. Being root means dedicated handling of theCriteriaNode
then not being root.- Returns:
- The query generated from the given
CriteriaNode
.
-
toQuery
Generates a query string for the givenCriteriaLeaf
.- Parameters:
aCriteriaLeaf
- TheCriteriaLeaf
for which to generate the query.isCriteriaTreeRoot
- True in case theCriteriaLeaf
is the root of theCriteria
tree. Being root means dedicated handling of theCriteriaLeaf
then not being root.- Returns:
- The query generated from the given
CriteriaLeaf
.
-