Class NonStandardCommons

java.lang.Object
org.tentackle.sql.NonStandardCommons

public class NonStandardCommons extends Object
Holds non-SQL-standard common features supported by most backends.
Author:
harald
  • Method Details

    • sqlCreateCommentOnTable

      public static String sqlCreateCommentOnTable(Backend backend, String tableName, String comment)
      Creates a COMMENT ON TABLE statement.
      Parameters:
      backend - the backend
      tableName - the table name with optional schema separated by a dot
      comment - optional comment, null if none
      Returns:
      the SQL code including the closing semicolon and newline
    • sqlCreateCommentOnColumn

      public static String sqlCreateCommentOnColumn(Backend backend, String tableName, String columnName, String comment)
      Creates a COMMENT ON COLUMN statement.
      Parameters:
      backend - the backend
      tableName - the table name with optional schema separated by a dot
      columnName - the column name
      comment - optional comment, null if none
      Returns:
      the SQL code including the closing semicolon and newline
    • sqlCreateSequence

      public static String sqlCreateSequence(String name, Long start, Long increment)
      Creates the SQL string to create a sequence.
      Parameters:
      name - the sequence name
      start - the optional start value, defaults to 1
      increment - the optional increment, defaults to 1
      Returns:
      the SQL code
    • sqlCreateCommentOnSequence

      public static String sqlCreateCommentOnSequence(Backend backend, String sequenceName, String comment)
      Creates a COMMENT ON SEQUENCE statement.
      Parameters:
      backend - the backend
      sequenceName - the name with optional schema separated by a dot
      comment - optional comment, null if none
      Returns:
      the SQL code including the closing semicolon and newline