org.apache.ojb.broker.ant
Class DdlUtilsDataHandling

java.lang.Object
  extended by org.apache.ojb.broker.ant.DdlUtilsDataHandling

public class DdlUtilsDataHandling
extends Object

Provides data input and output via DdlUtils.

Author:
Thomas Dudziak

Nested Class Summary
 class DdlUtilsDataHandling.DataRuleSet
           
 
Constructor Summary
DdlUtilsDataHandling()
          Creates a new data handling object.
 
Method Summary
 void getDataDTD(Writer output)
          Writes a DTD that can be used for data XML files matching the current model to the given writer.
 void getInsertDataSql(Reader input, Writer output)
          Returns the sql necessary to add the data XML contained in the given input stream.
 void insertData(Reader input, int batchSize)
          Returns the sql necessary to add the data XML contained in the given input stream.
 void setModel(org.apache.ddlutils.model.Database databaseModel, DescriptorRepository objModel)
          Sets the model that the handling works on.
 void setPlatform(org.apache.ddlutils.Platform platform)
          Sets the (connected) database platform to work against.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DdlUtilsDataHandling

public DdlUtilsDataHandling()
Creates a new data handling object.

Method Detail

setModel

public void setModel(org.apache.ddlutils.model.Database databaseModel,
                     DescriptorRepository objModel)
Sets the model that the handling works on.

Parameters:
databaseModel - The database model
objModel - The object model

setPlatform

public void setPlatform(org.apache.ddlutils.Platform platform)
Sets the (connected) database platform to work against.

Parameters:
platform - The platform

getDataDTD

public void getDataDTD(Writer output)
                throws DataTaskException
Writes a DTD that can be used for data XML files matching the current model to the given writer.

Parameters:
output - The writer to write the DTD to
Throws:
DataTaskException

getInsertDataSql

public void getInsertDataSql(Reader input,
                             Writer output)
                      throws DataTaskException
Returns the sql necessary to add the data XML contained in the given input stream. Note that the data is expected to match the repository metadata (not the table schema). Also note that you should not use the reader after passing it to this method except closing it (which is not done automatically).

Parameters:
input - A reader returning the content of the data file
output - The writer to write the sql to
Throws:
DataTaskException

insertData

public void insertData(Reader input,
                       int batchSize)
                throws DataTaskException
Returns the sql necessary to add the data XML contained in the given input stream. Note that the data is expected to match the repository metadata (not the table schema). Also note that you should not use the reader after passing it to this method except closing it (which is not done automatically).

Parameters:
input - A reader returning the content of the data file
batchSize - The batch size; use 1 for not batch insertion
Throws:
DataTaskException


Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.