Class AbstractStoreSchemaHandler

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()
      Method to clear out any cached schema information.
      void createDatabase​(java.lang.String catalogName, java.lang.String schemaName, java.util.Properties props, java.lang.Object connection)
      Method to create the specified database (catalog/schema).
      void createSchemaForClasses​(java.util.Set<java.lang.String> classNames, java.util.Properties props, java.lang.Object connection)
      Method to generate the required schema for the supplied classes.
      void deleteDatabase​(java.lang.String catalogName, java.lang.String schemaName, java.util.Properties props, java.lang.Object connection)
      Method to delete the specified database (catalog/schema).
      void deleteSchemaForClasses​(java.util.Set<java.lang.String> classNames, java.util.Properties props, java.lang.Object connection)
      Method to delete the schema for the supplied classes.
      void enableSchemaGeneration()
      Convenience method to override the specified schema generation properties and enable schema generation.
      StoreSchemaData getSchemaData​(java.lang.Object connection, java.lang.String name, java.lang.Object[] values)
      Accessor for schema data store under the provided name and defined by the specified values.
      StoreManager getStoreManager()  
      boolean isAutoCreateColumns()  
      boolean isAutoCreateConstraints()  
      boolean isAutoCreateDatabase()  
      boolean isAutoCreateTables()  
      boolean isAutoCreateWarnOnError()  
      boolean isAutoDeleteColumns()  
      boolean isValidateColumns()  
      boolean isValidateConstraints()  
      boolean isValidateTables()  
      void resetSchemaGeneration()
      Convenience method to reset the schema generation properties to their initial creation values, effectively undoing a call to enableSchemaGeneration.
      void validateSchema​(java.util.Set<java.lang.String> classNames, java.util.Properties props, java.lang.Object connection)
      Method to validate the schema for the supplied classes.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • autoCreateDatabase

        protected boolean autoCreateDatabase
        Whether to auto create any database (catalog/schema).
      • autoCreateTables

        protected boolean autoCreateTables
        Whether to auto create any tables.
      • autoCreateColumns

        protected boolean autoCreateColumns
        Whether to auto create any columns that are missing.
      • autoCreateConstraints

        protected boolean autoCreateConstraints
        Whether to auto create any constraints
      • autoCreateWarnOnError

        protected final boolean autoCreateWarnOnError
        Whether to warn only when any errors occur on auto-create.
      • autoDeleteColumns

        protected final boolean autoDeleteColumns
        Whether to auto delete any columns that are present but not in the metadata.
      • validateTables

        protected final boolean validateTables
        Whether to validate any tables
      • validateColumns

        protected final boolean validateColumns
        Whether to validate any columns
      • validateConstraints

        protected final boolean validateConstraints
        Whether to validate any constraints
    • Constructor Detail

      • AbstractStoreSchemaHandler

        public AbstractStoreSchemaHandler​(StoreManager storeMgr)
    • Method Detail

      • createDatabase

        public void createDatabase​(java.lang.String catalogName,
                                   java.lang.String schemaName,
                                   java.util.Properties props,
                                   java.lang.Object connection)
        Description copied from interface: StoreSchemaHandler
        Method to create the specified database (catalog/schema).
        Specified by:
        createDatabase in interface StoreSchemaHandler
        Parameters:
        catalogName - Name of the catalog
        schemaName - Name of the schema
        props - Any properties controlling the schema generation
        connection - Connection to use (null implies this will obtain its own connection)
      • deleteDatabase

        public void deleteDatabase​(java.lang.String catalogName,
                                   java.lang.String schemaName,
                                   java.util.Properties props,
                                   java.lang.Object connection)
        Description copied from interface: StoreSchemaHandler
        Method to delete the specified database (catalog/schema).
        Specified by:
        deleteDatabase in interface StoreSchemaHandler
        Parameters:
        catalogName - Name of the catalog
        schemaName - Name of the schema
        props - Any properties controlling the schema deletion
        connection - Connection to use (null implies this will obtain its own connection)
      • createSchemaForClasses

        public void createSchemaForClasses​(java.util.Set<java.lang.String> classNames,
                                           java.util.Properties props,
                                           java.lang.Object connection)
        Description copied from interface: StoreSchemaHandler
        Method to generate the required schema for the supplied classes. Note that this does not generate a "schema", just the tables. Refer to createDatabase to create a "schema".
        Specified by:
        createSchemaForClasses in interface StoreSchemaHandler
        Parameters:
        classNames - Names of the classes we want the schema generating for.
        props - Any properties controlling the schema generation
        connection - Connection to use (null implies this will obtain its own connection)
      • deleteSchemaForClasses

        public void deleteSchemaForClasses​(java.util.Set<java.lang.String> classNames,
                                           java.util.Properties props,
                                           java.lang.Object connection)
        Description copied from interface: StoreSchemaHandler
        Method to delete the schema for the supplied classes. Note that this does not delete a "schema", just the tables. Refer to deleteDatabase to delete a "schema".
        Specified by:
        deleteSchemaForClasses in interface StoreSchemaHandler
        Parameters:
        classNames - Names of the classes we want the schema deleting for.
        props - Any properties controlling the schema deletion
        connection - Connection to use (null implies this will obtain its own connection)
      • validateSchema

        public void validateSchema​(java.util.Set<java.lang.String> classNames,
                                   java.util.Properties props,
                                   java.lang.Object connection)
        Description copied from interface: StoreSchemaHandler
        Method to validate the schema for the supplied classes.
        Specified by:
        validateSchema in interface StoreSchemaHandler
        Parameters:
        classNames - Names of classes
        props - Any properties controlling schema validation
        connection - Connection to use (null implies this will obtain its own connection)
      • getSchemaData

        public StoreSchemaData getSchemaData​(java.lang.Object connection,
                                             java.lang.String name,
                                             java.lang.Object[] values)
        Description copied from interface: StoreSchemaHandler
        Accessor for schema data store under the provided name and defined by the specified values. The supported types of values is particular to the implementation.
        Specified by:
        getSchemaData in interface StoreSchemaHandler
        Parameters:
        connection - Connection to the datastore
        name - Name of the schema component to return.
        values - Value(s) to use as qualifier(s) for selecting the schema component
        Returns:
        Schema data definition for this name
      • enableSchemaGeneration

        public void enableSchemaGeneration()
        Description copied from interface: StoreSchemaHandler
        Convenience method to override the specified schema generation properties and enable schema generation.
        Specified by:
        enableSchemaGeneration in interface StoreSchemaHandler
      • resetSchemaGeneration

        public void resetSchemaGeneration()
        Description copied from interface: StoreSchemaHandler
        Convenience method to reset the schema generation properties to their initial creation values, effectively undoing a call to enableSchemaGeneration.
        Specified by:
        resetSchemaGeneration in interface StoreSchemaHandler