Package overit.geocall.sql.code.fragment
Class Fragment
java.lang.Object
overit.geocall.sql.code.fragment.Fragment
- Direct Known Subclasses:
ClauseFragment,ClausesFragment,EnclosedDoubleFragment,EnclosedFragment,FragmentSequence,StillFragment
The class represent a piece that will compose a SQL string.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanThis method is used to create the Fragment's SQL string.getCriterion(Criterion def) Gets the current set Criterion.voidoverlapCriterion(Criterion criterion) Adds an overlapping criterion.voidreplaceCriterion(Criterion criterion) Replace the oldest Criterion with a new one.Gets the translation, in sql string, of the fragment
-
Field Details
-
_criterion
-
-
Constructor Details
-
Fragment
public Fragment()
-
-
Method Details
-
overlapCriterion
Adds an overlapping 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 sb, String header, Criterion defaultCriterion, Map<String, Object> context) This method is used to create the Fragment's SQL string.- Parameters:
sb- The StringBuilder used to add the current piece (Fragment) of SQL cod, to create the complete SQL string.header- The string previus the Fragment's code.defaultCriterion- 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
Gets the translation, in sql string, of the fragment- Parameters:
defaultCriterion- The defautl criterion used as decision criterion.context- The input values to define the clauses of the sql string.- Returns:
- The translation, in sql string, of the fragment
-