Class ValuesFragment

java.lang.Object
overit.geocall.sql.code.fragment.DoubleFragment
overit.geocall.sql.code.fragment.ValuesFragment

public class ValuesFragment extends DoubleFragment
The class extends DoubleFragment and aims to implement a list of ValueFragment. This class allow to create a list of value separated by a comma.
For example it can be used in the INSERT statement like this " INSERT INTO AUSENAME (field1,filed2,field3) .....".
  • Field Details

    • _separator1

      protected String _separator1
    • _separator2

      protected String _separator2
    • _re

      protected Pattern[] _re
    • _separator

      protected String _separator
  • Constructor Details

    • ValuesFragment

      public ValuesFragment(String[] re, String separator1, String separator2)
      The class's constructor that create the double fargment and set the separator between the values inside the fragments.
      Parameters:
      re - The value pattern's array
      separator1 - The first separator, for the first fragment.
      separator2 - The Second separator, for the second fragment.
  • Method Details

    • appendTo

      public boolean appendTo(StringBuilder sb1, String header1, StringBuilder sb2, String header2, Criterion criterion, Map<String,Object> context)
      Description copied from class: DoubleFragment
      This method is used to create the double Fragment's SQL string.
      Specified by:
      appendTo in class DoubleFragment
      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.