org.unitils.dbmaintainer.structure.impl
Class XsdDataSetStructureGenerator

java.lang.Object
  extended by org.unitils.dbmaintainer.util.BaseDatabaseAccessor
      extended by org.unitils.dbmaintainer.structure.impl.XsdDataSetStructureGenerator
All Implemented Interfaces:
DataSetStructureGenerator, DatabaseAccessing

public class XsdDataSetStructureGenerator
extends BaseDatabaseAccessor
implements DataSetStructureGenerator

Implementation of DataSetStructureGenerator that generates xml schema files for data sets.

This will generate an xsd for each configured database schema. Each database schema will be described in an xsd named 'schema_name'.xsd. A general dataset.xsd will also be generated. This xsd refers to the database schema specific xsds.

Author:
Tim Ducheyne, Filip Neven

Field Summary
static String PROPKEY_XSD_COMPLEX_TYPE_SUFFIX
           
static String PROPKEY_XSD_DIR_NAME
           
 
Fields inherited from class org.unitils.dbmaintainer.util.BaseDatabaseAccessor
configuration, dbSupports, defaultDbSupport, sqlHandler
 
Constructor Summary
XsdDataSetStructureGenerator()
           
 
Method Summary
protected  void doInit(Properties configuration)
          Initializes the generator.
protected  void generateDatabaseSchemaXsd(DbSupport dbSupport, File xsdDirectory)
          Generates an XSD for the database schema of the given db support.
 void generateDataSetStructure()
          Generates the XSDs, and writes them to the target directory specified by the property PROPKEY_XSD_DIR_NAME.
protected  void generateDataSetXsd(File xsdDirectory)
          Generates a general dataset xsd that will refer to database schema specific dataset XSDs.
 
Methods inherited from class org.unitils.dbmaintainer.util.BaseDatabaseAccessor
getDbSupport, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.unitils.dbmaintainer.util.DatabaseAccessing
init
 

Field Detail

PROPKEY_XSD_DIR_NAME

public static final String PROPKEY_XSD_DIR_NAME
See Also:
Constant Field Values

PROPKEY_XSD_COMPLEX_TYPE_SUFFIX

public static final String PROPKEY_XSD_COMPLEX_TYPE_SUFFIX
See Also:
Constant Field Values
Constructor Detail

XsdDataSetStructureGenerator

public XsdDataSetStructureGenerator()
Method Detail

doInit

protected void doInit(Properties configuration)
Initializes the generator.

Overrides:
doInit in class BaseDatabaseAccessor
Parameters:
configuration - The config, not null

generateDataSetStructure

public void generateDataSetStructure()
Generates the XSDs, and writes them to the target directory specified by the property PROPKEY_XSD_DIR_NAME.

Specified by:
generateDataSetStructure in interface DataSetStructureGenerator

generateDataSetXsd

protected void generateDataSetXsd(File xsdDirectory)
Generates a general dataset xsd that will refer to database schema specific dataset XSDs.

Parameters:
xsdDirectory - The target directory, not null

generateDatabaseSchemaXsd

protected void generateDatabaseSchemaXsd(DbSupport dbSupport,
                                         File xsdDirectory)
Generates an XSD for the database schema of the given db support.

Parameters:
dbSupport - The db support, not null
xsdDirectory - The target directory, not null


Copyright © 2011. All Rights Reserved.