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
Constructors -
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:
fromCriteriain interfaceQueryFactory<String>- Parameters:
aCriteria- TheCriteriafrom which to generate the query.- Returns:
- A query generated from the provided
Criteria(tree).
-
toQuery
Generates a query string for the givenCriteriaNode.- Parameters:
aCriteriaNode- TheCriteriaNodefor which to generate the query.isCriteriaTreeRoot- True in case theCriteriaNodeis the root of theCriteriatree. Being root means dedicated handling of theCriteriaNodethen not being root.- Returns:
- The query generated from the given
CriteriaNode.
-
toQuery
Generates a query string for the givenCriteriaLeaf.- Parameters:
aCriteriaLeaf- TheCriteriaLeaffor which to generate the query.isCriteriaTreeRoot- True in case theCriteriaLeafis the root of theCriteriatree. Being root means dedicated handling of theCriteriaLeafthen not being root.- Returns:
- The query generated from the given
CriteriaLeaf.
-