|
deegree 2.5 (2011/06/29 09:44 build-8-official) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 java.lang.String |
FT_PREFIX
|
protected static int |
JOIN_TABLE
|
protected static int |
MULTI_PROPERTY_TABLE
|
protected MappedGMLSchema |
schema
|
protected java.util.Set<java.lang.String> |
sequences
|
protected java.util.Map<java.lang.String,DDLGenerator.TableDefinition> |
tables
|
Constructor Summary | |
---|---|
protected |
DDLGenerator(java.net.URL schemaURL)
Creates a new instance of DDLGenerator from the given parameters. |
Method Summary | |
---|---|
protected abstract java.lang.StringBuffer |
generateCreateIndexStmts(DDLGenerator.TableDefinition table)
Generates the DDL statements necessary for the creation of standard indexes for the given table definition. |
protected java.lang.StringBuffer |
generateCreateSchemaStmts(java.lang.String dbSchemaName)
Generates the DDL statements necessary for the creation of the given schema. |
void |
generateCreateScript(java.lang.String outputFile)
|
void |
generateCreateScript(java.lang.String outputFile,
java.lang.String dbSchema)
Generates the DDL statements to create a relational schema that backs the GML schema. |
protected java.lang.StringBuffer |
generateCreateSequenceStmt(java.lang.String sequenceName)
Generates the DDL statements necessary for the creation of the given sequence. |
protected abstract java.lang.StringBuffer |
generateCreateTableStmt(DDLGenerator.TableDefinition table)
Generates the DDL statements necessary for the creation of the given table definition. |
protected java.lang.StringBuffer |
generateDropIndexStmts(DDLGenerator.TableDefinition table)
Generates the DDL statements necessary for the dropping of standard indexes for the given table definition. |
protected java.lang.StringBuffer |
generateDropSchemaStmt(java.lang.String dbSchemaName)
Generates the DDL statements necessary for the removal of the given schema. |
void |
generateDropScript(java.lang.String outputFile,
java.lang.String dbSchema)
Generates the DDL statements that can be used to remove the relational schema again. |
protected java.lang.StringBuffer |
generateDropSequenceStmt(java.lang.String sequenceName)
Generates the DDL statements necessary for the removal of the given sequence. |
protected java.lang.StringBuffer |
generateDropTableStmt(DDLGenerator.TableDefinition table)
Generates the DDL statements necessary for the removal of the given table definition. |
protected abstract java.lang.StringBuffer |
generateSetSchemaStmt(java.lang.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(java.lang.String[] args)
|
java.lang.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 java.lang.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 java.util.Map<java.lang.String,DDLGenerator.TableDefinition> tables
protected java.util.Set<java.lang.String> sequences
Constructor Detail |
---|
protected DDLGenerator(java.net.URL schemaURL) throws java.net.MalformedURLException, java.io.IOException, org.xml.sax.SAXException, XMLParsingException, XMLSchemaException, UnknownCRSException
DDLGenerator
from the given parameters.
schemaURL
-
java.net.MalformedURLException
java.io.IOException
org.xml.sax.SAXException
XMLParsingException
XMLSchemaException
UnknownCRSException
Method Detail |
---|
protected abstract java.lang.StringBuffer generateSetSchemaStmt(java.lang.String dbSchemaName)
dbSchemaName
-
protected java.lang.StringBuffer generateCreateSchemaStmts(java.lang.String dbSchemaName)
dbSchemaName
-
protected abstract java.lang.StringBuffer generateCreateTableStmt(DDLGenerator.TableDefinition table)
table
-
protected abstract java.lang.StringBuffer generateCreateIndexStmts(DDLGenerator.TableDefinition table)
table
-
protected java.lang.StringBuffer generateCreateSequenceStmt(java.lang.String sequenceName)
sequenceName
-
protected java.lang.StringBuffer generateDropSchemaStmt(java.lang.String dbSchemaName)
dbSchemaName
-
protected java.lang.StringBuffer generateDropTableStmt(DDLGenerator.TableDefinition table)
table
-
protected java.lang.StringBuffer generateDropIndexStmts(DDLGenerator.TableDefinition table)
table
-
protected java.lang.StringBuffer generateDropSequenceStmt(java.lang.String sequenceName)
sequenceName
-
protected DDLGenerator.TableDefinition[] getTables(int type)
type
- FEATURE_TYPE_TABLE, JOIN_TABLE or MULTI_PROPERTY_TABLE
public void generateCreateScript(java.lang.String outputFile) throws java.io.IOException
outputFile
-
java.io.IOException
public void generateCreateScript(java.lang.String outputFile, java.lang.String dbSchema) throws java.io.IOException
outputFile
- dbSchema
- (may be null)
java.io.IOException
public void generateDropScript(java.lang.String outputFile, java.lang.String dbSchema) throws java.io.IOException
outputFile
- dbSchema
- (may be null)
java.io.IOException
public static void main(java.lang.String[] args) throws java.io.IOException, org.xml.sax.SAXException, XMLParsingException, XMLSchemaException, UnknownCRSException
args
-
java.io.IOException
org.xml.sax.SAXException
XMLParsingException
XMLSchemaException
UnknownCRSException
public java.lang.String toString()
toString
in class java.lang.Object
|
deegree 2.5 (2011/06/29 09:44 build-8-official) | |||||||||
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