Package org.refcodes.criteria
Class ExpressionQueryFactoryImpl
- java.lang.Object
-
- org.refcodes.criteria.ExpressionQueryFactoryImpl
-
- All Implemented Interfaces:
QueryFactory<java.lang.String>
public class ExpressionQueryFactoryImpl extends java.lang.Object implements QueryFactory<java.lang.String>
TheExpressionCriteriaFactoryImpl
is capable of creating queryString
instances fromCriteria
instances; the queryString
instances which can be used as parts of SQL statements.- Version:
- $Id: $Id
- Author:
- steiner
-
-
Constructor Summary
Constructors Constructor Description ExpressionQueryFactoryImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
fromCriteria(Criteria aCriteria)
Generates a query from the providedCriteria
(tree).java.lang.String
toQuery(IntersectWithCriteria aCriteriaNode, boolean isCriteriaTreeRoot)
Generates a query string for the givenCriteriaNode
.java.lang.String
toQuery(LessThanCriteria<?> aCriteriaLeaf, boolean isCriteriaTreeRoot)
Generates a query string for the givenCriteriaLeaf
.
-
-
-
Method Detail
-
fromCriteria
public java.lang.String fromCriteria(Criteria aCriteria)
Generates a query from the providedCriteria
(tree).- Specified by:
fromCriteria
in interfaceQueryFactory<java.lang.String>
- Parameters:
aCriteria
- TheCriteria
from which to generate the query.- Returns:
- A query generated from the provided
Criteria
(tree).
-
toQuery
public java.lang.String toQuery(IntersectWithCriteria aCriteriaNode, boolean isCriteriaTreeRoot)
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
public java.lang.String toQuery(LessThanCriteria<?> aCriteriaLeaf, boolean isCriteriaTreeRoot)
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
.
-
-