Class DoubleFragment

java.lang.Object
overit.geocall.sql.code.fragment.DoubleFragment
Direct Known Subclasses:
DoubleFragmentSequence, ValueFragment, ValuesFragment

public abstract class DoubleFragment extends Object
The class represent a double piece of SQL string.
  • Field Details

    • _criterion

      protected Criterion _criterion
  • Constructor Details

    • DoubleFragment

      public DoubleFragment()
  • Method Details

    • addCriterion

      public void addCriterion(Criterion criterion)
      Adds a prioritized criterion.
      Parameters:
      criterion - the priority criterion to be addes to the current criterion
    • replaceCriterion

      public void replaceCriterion(Criterion criterion)
      Replace the oldest Criterion with a new one.
      Parameters:
      criterion - The new Criterion to set.
    • getCriterion

      public Criterion getCriterion(Criterion def)
      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:
      true if there's a Fragment to add, false otherwise.
    • toString

      public String toString(Criterion criterion, Map<String,Object> context)