|
deegree 2.6-pre (2011/11/29 00:10 build-378-unofficial) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.deegree.tools.datastore.DDLGenerator
public abstract class DDLGenerator
Abstract base class for DDL generation from annotated GML schema files.
This abstract base class only implements the functionality needed to retrieve the necessary tables and columns used in an annotated GML schema. Some DDL generation may be dependent on the specific SQL backend to be used, so this is implemented in concrete extensions of this class.
Nested Class Summary | |
---|---|
(package private) class |
DDLGenerator.ColumnDefinition
|
(package private) class |
DDLGenerator.TableDefinition
|
Field Summary | |
---|---|
protected static int |
FEATURE_TYPE_TABLE
|
protected static String |
FT_PREFIX
|
protected static int |
JOIN_TABLE
|
protected static int |
MULTI_PROPERTY_TABLE
|
protected MappedGMLSchema |
schema
|
protected Set<String> |
sequences
|
protected Map<String,DDLGenerator.TableDefinition> |
tables
|
Constructor Summary | |
---|---|
protected |
DDLGenerator(URL schemaURL)
Creates a new instance of DDLGenerator from the given parameters. |
Method Summary | |
---|---|
protected abstract StringBuffer |
generateCreateIndexStmts(DDLGenerator.TableDefinition table)
Generates the DDL statements necessary for the creation of standard indexes for the given table definition. |
protected StringBuffer |
generateCreateSchemaStmts(String dbSchemaName)
Generates the DDL statements necessary for the creation of the given schema. |
void |
generateCreateScript(String outputFile)
|
void |
generateCreateScript(String outputFile,
String dbSchema)
Generates the DDL statements to create a relational schema that backs the GML schema. |
protected StringBuffer |
generateCreateSequenceStmt(String sequenceName)
Generates the DDL statements necessary for the creation of the given sequence. |
protected abstract StringBuffer |
generateCreateTableStmt(DDLGenerator.TableDefinition table)
Generates the DDL statements necessary for the creation of the given table definition. |
protected StringBuffer |
generateDropIndexStmts(DDLGenerator.TableDefinition table)
Generates the DDL statements necessary for the dropping of standard indexes for the given table definition. |
protected StringBuffer |
generateDropSchemaStmt(String dbSchemaName)
Generates the DDL statements necessary for the removal of the given schema. |
void |
generateDropScript(String outputFile,
String dbSchema)
Generates the DDL statements that can be used to remove the relational schema again. |
protected StringBuffer |
generateDropSequenceStmt(String sequenceName)
Generates the DDL statements necessary for the removal of the given sequence. |
protected StringBuffer |
generateDropTableStmt(DDLGenerator.TableDefinition table)
Generates the DDL statements necessary for the removal of the given table definition. |
protected abstract StringBuffer |
generateSetSchemaStmt(String dbSchemaName)
Generates the SQL statements necessary for setting the schema search path. |
protected DDLGenerator.TableDefinition[] |
getTables(int type)
Returns all table definitions of the given type. |
static void |
main(String[] args)
|
String |
toString()
Returns a string representation of the object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final String FT_PREFIX
protected static final int FEATURE_TYPE_TABLE
protected static final int JOIN_TABLE
protected static final int MULTI_PROPERTY_TABLE
protected MappedGMLSchema schema
protected Map<String,DDLGenerator.TableDefinition> tables
protected Set<String> sequences
Constructor Detail |
---|
protected DDLGenerator(URL schemaURL) throws MalformedURLException, IOException, SAXException, XMLParsingException, XMLSchemaException, UnknownCRSException
DDLGenerator
from the given parameters.
schemaURL
-
MalformedURLException
IOException
SAXException
XMLParsingException
XMLSchemaException
UnknownCRSException
Method Detail |
---|
protected abstract StringBuffer generateSetSchemaStmt(String dbSchemaName)
dbSchemaName
-
protected StringBuffer generateCreateSchemaStmts(String dbSchemaName)
dbSchemaName
-
protected abstract StringBuffer generateCreateTableStmt(DDLGenerator.TableDefinition table)
table
-
protected abstract StringBuffer generateCreateIndexStmts(DDLGenerator.TableDefinition table)
table
-
protected StringBuffer generateCreateSequenceStmt(String sequenceName)
sequenceName
-
protected StringBuffer generateDropSchemaStmt(String dbSchemaName)
dbSchemaName
-
protected StringBuffer generateDropTableStmt(DDLGenerator.TableDefinition table)
table
-
protected StringBuffer generateDropIndexStmts(DDLGenerator.TableDefinition table)
table
-
protected StringBuffer generateDropSequenceStmt(String sequenceName)
sequenceName
-
protected DDLGenerator.TableDefinition[] getTables(int type)
type
- FEATURE_TYPE_TABLE, JOIN_TABLE or MULTI_PROPERTY_TABLE
public void generateCreateScript(String outputFile) throws IOException
outputFile
-
IOException
public void generateCreateScript(String outputFile, String dbSchema) throws IOException
outputFile
- dbSchema
- (may be null)
IOException
public void generateDropScript(String outputFile, String dbSchema) throws IOException
outputFile
- dbSchema
- (may be null)
IOException
public static void main(String[] args) throws IOException, SAXException, XMLParsingException, XMLSchemaException, UnknownCRSException
args
-
IOException
SAXException
XMLParsingException
XMLSchemaException
UnknownCRSException
public String toString()
toString
in class Object
|
deegree 2.6-pre (2011/11/29 00:10 build-378-unofficial) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org