Class CheckSchemaOperation

  • public class CheckSchemaOperation
    extends java.lang.Object
    An operation which synchronously checks the DB schema in the run() method. The addVariableReplacement(String, String) method return the instance to enable method chaining.
    • Field Detail


        public static final java.lang.String SCHEMA_OBJECT_PREFIX_VARIABLE
        See Also:
        Constant Field Values

        public static final java.lang.String TABLE_SPACE_VARIABLE
        See Also:
        Constant Field Values
    • Constructor Detail

      • CheckSchemaOperation

        public CheckSchemaOperation​(ConnectionHelper connectionhelper,
                                    java.lang.String tableName)
        connectionhelper - the connection helper
        ddlStream - the stream of the DDL to use to create the schema if necessary (closed by the run() method)
        tableName - the name of the table to use for the schema-existence-check
    • Method Detail

      • addVariableReplacement

        public CheckSchemaOperation addVariableReplacement​(java.lang.String var,
                                                           java.lang.String replacement)
        Adds a variable replacement mapping.
        var - the variable
        replacement - the replacement value
      • run

        public void run()
                 throws java.sql.SQLException,
        Checks if the required schema objects exist and creates them if they don't exist yet.
        java.sql.SQLException - if an error occurs - if an error occurs