Package overit.geocall.sql.code.fragment
Class DoubleFragment
java.lang.Object
overit.geocall.sql.code.fragment.DoubleFragment
- Direct Known Subclasses:
DoubleFragmentSequence,ValueFragment,ValuesFragment
The class represent a double piece of SQL string.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCriterion(Criterion criterion) Adds a prioritized criterion.abstract booleanappendTo(StringBuilder sb1, String header1, StringBuilder sb2, String header2, Criterion criterion, Map<String, Object> context) This method is used to create the double Fragment's SQL string.getCriterion(Criterion def) Gets the current set Criterion.voidreplaceCriterion(Criterion criterion) Replace the oldest Criterion with a new one.
-
Field Details
-
_criterion
-
-
Constructor Details
-
DoubleFragment
public DoubleFragment()
-
-
Method Details
-
addCriterion
Adds a prioritized criterion.- Parameters:
criterion- the priority criterion to be addes to the current criterion
-
replaceCriterion
Replace the oldest Criterion with a new one.- Parameters:
criterion- The new Criterion to set.
-
getCriterion
Gets the current set Criterion.- Parameters:
def- The default object to return if there's no Criterion set.- Returns:
- The current Criterion if it's set, def otherwise.
-
appendTo
public abstract boolean appendTo(StringBuilder sb1, String header1, StringBuilder sb2, String header2, Criterion criterion, Map<String, Object> context) This method is used to create the double Fragment's SQL string.- Parameters:
sb1- The StringBuilder used to add the first piece (Fragment) of SQL code, to create the complete SQL string.header1- The string previus the first Fragment's code.sb2- The StringBuilder used to add the second piece (Fragment) of SQL code, to create the complete SQL string.header2- The string previus the second Fragment's code.criterion- The Criterion, set by default, to apply.context- The input values to define the clauses of the sql string.- Returns:
trueif there's a Fragment to add,falseotherwise.
-
toString
-