public abstract class AbstractResourceDefinitionGenerator extends Object implements ResourceDefinitionGenerator
ResourceDefinitionGenerator.GenerationException
Constructor and Description |
---|
AbstractResourceDefinitionGenerator() |
Modifier and Type | Method and Description |
---|---|
protected int |
createDefs(File subDirObj,
String databaseName,
String exclusionPattern)
Creates resource definitions.
|
protected File |
createSubDir(String relativeSubDir,
String sqlResourcesDir)
Creates sub directory if it does not exist.
|
int |
generate(String relativeSubDir,
String databaseName,
String exclusionPattern)
Creates resource definition files, one per table in the provided database.
|
protected abstract String |
getColumnsQuery()
Hook method for implementation by db-specific classes.
|
protected String |
getTableExclusionQueryClause()
Returns query clause for a table name exclusion pattern.
|
public int generate(String relativeSubDir, String databaseName, String exclusionPattern) throws ResourceDefinitionGenerator.GenerationException
ResourceDefinitionGenerator
generate
in interface ResourceDefinitionGenerator
relativeSubDir
- directory path relative to sql resources directory to createdatabaseName
- database nameexclusionPattern
- table name pattern to excludeResourceDefinitionGenerator.GenerationException
- if a database access or file write error occursprotected int createDefs(File subDirObj, String databaseName, String exclusionPattern) throws ResourceDefinitionGenerator.GenerationException
subDirObj
- subdir file objectdatabaseName
- database nameGenerationException
- if a database access or file write error occursResourceDefinitionGenerator.GenerationException
protected abstract String getColumnsQuery()
protected String getTableExclusionQueryClause()
protected File createSubDir(String relativeSubDir, String sqlResourcesDir) throws ResourceDefinitionGenerator.GenerationException
relativeSubDir
- directory path relative to sql resources directory to createsqlResourcesDir
- absolute sql resources directoryGenerationException
- if subdir could not be created, or it exists and is not writable or emptyResourceDefinitionGenerator.GenerationException
Copyright © 2011-2018 restSQL Project Contributors