org.deegree.feature.persistence.sql.ddl
Class DDLCreator

java.lang.Object
  extended by org.deegree.feature.persistence.sql.ddl.DDLCreator
Direct Known Subclasses:
MSSQLDDLCreator, OracleDDLCreator, PostGISDDLCreator

public abstract class DDLCreator
extends Object

Creates DDL (DataDefinitionLanguage) scripts from MappedAppSchema instances.

Version:
$Revision: 31572 $, $Date: 2011-08-18 11:11:21 +0200 (Thu, 18 Aug 2011) $
Author:
Markus Schneider, last edited by: $Author: mschneider $

Field Summary
protected  QTableName currentFtTable
           
protected  MappedAppSchema schema
           
 
Constructor Summary
protected DDLCreator(MappedAppSchema schema, SQLDialect dialect)
          Creates a new DDLCreator instance for the given MappedAppSchema.
 
Method Summary
protected abstract  StringBuffer createJoinedTable(QTableName fromTable, TableJoin jc, List<StringBuffer> ddls)
           
protected abstract  void featureMappingSnippet(StringBuffer sql, FeatureMapping mapping)
           
protected abstract  void geometryMappingSnippet(StringBuffer sql, GeometryMapping mapping, List<StringBuffer> ddls, QTableName table)
           
protected abstract  List<String> getBLOBCreates()
           
protected abstract  String getDBType(BaseType type)
           
 String[] getDDL()
          Returns the DDL statements for creating the relational schema required by the MappedAppSchema.
static DDLCreator newInstance(MappedAppSchema appSchema, SQLDialect dialect)
           
protected abstract  void primitiveMappingSnippet(StringBuffer sql, PrimitiveMapping mapping)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

schema

protected final MappedAppSchema schema

currentFtTable

protected QTableName currentFtTable
Constructor Detail

DDLCreator

protected DDLCreator(MappedAppSchema schema,
                     SQLDialect dialect)
Creates a new DDLCreator instance for the given MappedAppSchema.

Parameters:
schema - mapped application schema, must not be null
dialect - SQL dialect, must not be null
Method Detail

getDDL

public String[] getDDL()
Returns the DDL statements for creating the relational schema required by the MappedAppSchema.

Returns:
the DDL statements, never null

getBLOBCreates

protected abstract List<String> getBLOBCreates()

primitiveMappingSnippet

protected abstract void primitiveMappingSnippet(StringBuffer sql,
                                                PrimitiveMapping mapping)

geometryMappingSnippet

protected abstract void geometryMappingSnippet(StringBuffer sql,
                                               GeometryMapping mapping,
                                               List<StringBuffer> ddls,
                                               QTableName table)

featureMappingSnippet

protected abstract void featureMappingSnippet(StringBuffer sql,
                                              FeatureMapping mapping)

createJoinedTable

protected abstract StringBuffer createJoinedTable(QTableName fromTable,
                                                  TableJoin jc,
                                                  List<StringBuffer> ddls)

getDBType

protected abstract String getDBType(BaseType type)

newInstance

public static DDLCreator newInstance(MappedAppSchema appSchema,
                                     SQLDialect dialect)


Copyright © 2011. All Rights Reserved.