Class SqlShortCut

java.lang.Object
overit.geocall.sql.SqlShortCut

public class SqlShortCut extends Object
This class exposes some utility methods that can be used to quickly create Sql clauses
  • Constructor Details

    • SqlShortCut

      public SqlShortCut()
  • Method Details

    • getSequenceClause

      public static String getSequenceClause(PooledConnection conn, String tableName)
      Returns the correct string that must be used to address the sequence in the Sql clause, depending on the DBType
      Parameters:
      conn - The PooledConnection used
      tableName - The name of the table for which we want to create the clause
      Returns:
      The string that address correctly the sequence
    • getWhereInAnd

      public static String getWhereInAnd(String[] ss)
      Returns an Sql where clause, starting from the array of strings passed as parameter. Every item in the array is inserted between two round brackets, to allow to insert complex clauses
      Parameters:
      ss - The array of strings that will be used to compose the Where clause
      Returns:
      A Sql where clause containing the items of the array
    • getInsertValues

      public static String getInsertValues(HashSet fields)
      Returns a string in which every element of the HashSet passed as parameter is separated from the others by a comma character.
      Parameters:
      fields - A set of objects
      Returns:
      A string that can be used as a list of values for an insert Sql clause