You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ddlutils-dev@db.apache.org by to...@apache.org on 2006/03/12 17:29:22 UTC
svn commit: r385311 [1/3] - in /db/ddlutils/trunk: ./ src/doc/
src/doc/src/documentation/ src/doc/src/documentation/content/xdocs/
src/doc/src/documentation/content/xdocs/images/
src/java/org/apache/ddlutils/platform/firebird/ src/java/org/apache/ddlut...
Author: tomdz
Date: Sun Mar 12 08:29:21 2006
New Revision: 385311
URL: http://svn.apache.org/viewcvs?rev=385311&view=rev
Log:
Updated documentation
Minor changes to some of the platform
Modified:
db/ddlutils/trunk/ToDo.txt
db/ddlutils/trunk/src/doc/model.jude
db/ddlutils/trunk/src/doc/src/documentation/content/xdocs/ant-tasks.xml
db/ddlutils/trunk/src/doc/src/documentation/content/xdocs/api-usage.xml
db/ddlutils/trunk/src/doc/src/documentation/content/xdocs/database-support.xml
db/ddlutils/trunk/src/doc/src/documentation/content/xdocs/images/model.png
db/ddlutils/trunk/src/doc/src/documentation/content/xdocs/index.xml
db/ddlutils/trunk/src/doc/src/documentation/content/xdocs/schema.xml
db/ddlutils/trunk/src/doc/src/documentation/content/xdocs/site.xml
db/ddlutils/trunk/src/doc/src/documentation/skinconf.xml
db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/firebird/FirebirdPlatform.java
db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/hsqldb/HsqlDbPlatform.java
db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/interbase/InterbasePlatform.java
db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/oracle/Oracle8Platform.java
db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/postgresql/PostgreSqlPlatform.java
Modified: db/ddlutils/trunk/ToDo.txt
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/ToDo.txt?rev=385311&r1=385310&r2=385311&view=diff
==============================================================================
--- db/ddlutils/trunk/ToDo.txt (original)
+++ db/ddlutils/trunk/ToDo.txt Sun Mar 12 08:29:21 2006
@@ -1,18 +1,9 @@
List of things to be done for the next version of DdlUtils:
-* Separate generation of alter statements for an existing databases from the reading
- of the model from the existing database to allow for alter statement generation with two
- database models without having to connect to the database and thus allow for testing the
- alter statement generation without an actual live database
-* Add unit tests for:
- - SQL generation (including alteration)
- - Roundtrip (database specific)
* Add support for chosing the character set (ASCII, UNICODE) if the database supports it
(perhaps a more generic configuration mechanism for overriding defaults)
* Add the ability to configure the datatype mapping (ant task, API)
-* Replace System.out/System.err writes with logging statements
* Extract interfaces from the model classes and inroduce a factory for creating the concrete model objects
-* Add functionality and ant tasks to dump data from the database
* Add integration with DbUnit to allow DbUnit to use the schema and data files
* Add notion of jdbc types not directly supported by the database which are mapped to some large binary type,
and add warnings when they are used (-> logging)
Modified: db/ddlutils/trunk/src/doc/model.jude
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/doc/model.jude?rev=385311&r1=385310&r2=385311&view=diff
==============================================================================
Binary files - no diff available.
Modified: db/ddlutils/trunk/src/doc/src/documentation/content/xdocs/ant-tasks.xml
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/doc/src/documentation/content/xdocs/ant-tasks.xml?rev=385311&r1=385310&r2=385311&view=diff
==============================================================================
--- db/ddlutils/trunk/src/doc/src/documentation/content/xdocs/ant-tasks.xml (original)
+++ db/ddlutils/trunk/src/doc/src/documentation/content/xdocs/ant-tasks.xml Sun Mar 12 08:29:21 2006
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-15"?>
<!--
- Copyright 2002-2005 The Apache Software Foundation
+ Copyright 2002-2006 The Apache Software Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -91,7 +91,7 @@
classname="org.apache.ddlutils.task.DatabaseToDdlTask">
<classpath refid="runtime-classpath"/>
</taskdef>
- <databaseToDdl>
+ <databaseToDdl modelName="MyModel">
<database url="jdbc:derby:ddlutils"
driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
username=""
@@ -121,41 +121,39 @@
<table>
<tr>
<th>Attribute</th>
- <th>Required ?</th>
- <th>Possible values</th>
- <th>Default value</th>
+ <th>Required?</th>
+ <th>Possible values</th>
+ <th>Default value</th>
<th>Meaning</th>
</tr>
<tr>
- <td>schemaFile</td>
+ <td>databaseType</td>
<td>no</td>
- <td></td>
+ <td>axion, cloudscape, db2, derby, firebird, hsqldb, interbase, maxdb, mckoi, mssql,
+ mysql, mysql5, oracle, oracle9, oracle10, postgresql, sapdb, sybase</td>
<td></td>
<td>
- The single file that contains the database file. Use this instead of an embedded
- <code>fileset</code> if you only have one schema file.
+ The database type. You should only need to specify this if DdlUtils is not able to
+ derive the setting from the name of the used jdbc driver or the jdbc connection url.
+ If you need to specify this, please post your jdbc driver and connection url combo
+ to the user mailing list so that DdlUtils can be enhanced to support this combo.
</td>
</tr>
<tr>
- <td>databaseType</td>
+ <td>schemaFile</td>
<td>no</td>
- <td>
- axion, cloudscape, db2, derby, firebird, hsqldb, interbase, maxdb, mckoi, mssql,
- mysql, oracle, oracle9, postgresql, sapdb, sybase
- </td>
+ <td></td>
<td></td>
<td>
- The database type. You should only need to specify this if DdlUtils is not able to
- derive the setting from the name of the used jdbc driver or the jdbc connection url.
- If you need to specify this, please post your jdbc driver and connection url combo
- to the user mailing list so that DdlUtils can be enhanced to support this combo.
+ The single file that contains the database file. Use this instead of an embedded
+ <code>fileset</code> if you only have one schema file.
</td>
</tr>
<tr>
<td>useDelimitedSqlIdentifiers</td>
<td>no</td>
- <td>true,false</td>
- <td>true</td>
+ <td>true, false</td>
+ <td>false</td>
<td>
Whether DdlUtils shall use delimited (quoted) identifiers (table names, column names etc.)
In most databases, undelimited identifiers will be converted to uppercase by the database,
@@ -166,6 +164,26 @@
important in every SQL command executed against the database.
</td>
</tr>
+ <tr>
+ <td>useInternalDtd</td>
+ <td>no</td>
+ <td>true, false</td>
+ <td>true</td>
+ <td>
+ Whether DdlUtils shall use the embedded DTD for validating the schema XML (if it matches
+ <code>http://db.apache.org/torque/dtd/database.dtd</code>). This is useful for instance
+ for environments where no web access is possible.
+ </td>
+ </tr>
+ <tr>
+ <td>validateXml</td>
+ <td>no</td>
+ <td>true, false</td>
+ <td>false</td>
+ <td>
+ Whether DdlUtils shall validate the schema XML against the DTD.
+ </td>
+ </tr>
</table>
<section>
<title>Subelement: fileset</title>
@@ -202,15 +220,15 @@
<table>
<tr>
<th>Attribute</th>
- <th>Required ?</th>
- <th>Possible values</th>
- <th>Default value</th>
+ <th>Required?</th>
+ <th>Possible values</th>
+ <th>Default value</th>
<th>Meaning</th>
</tr>
<tr>
<td>failOnError</td>
<td>no</td>
- <td>true,false</td>
+ <td>true, false</td>
<td>true</td>
<td>Specifies whether the execution shall stop if an error has occurred while the task runs.</td>
</tr>
@@ -223,9 +241,9 @@
<table>
<tr>
<th>Attribute</th>
- <th>Required ?</th>
- <th>Possible values</th>
- <th>Default value</th>
+ <th>Required?</th>
+ <th>Possible values</th>
+ <th>Default value</th>
<th>Meaning</th>
</tr>
<tr>
@@ -237,24 +255,24 @@
for the parameters supported by the individual platforms.</td>
</tr>
<tr>
- <td>value</td>
- <td>no</td>
- <td></td>
- <td></td>
- <td>The parameter value. If none is given, <code>null</code> is used.</td>
- </tr>
- <tr>
<td>platforms</td>
<td>no</td>
<td></td>
<td></td>
<td>
Comma-separated list of platforms where the parameter shall be processed (see
- <code>databaseType</code> attribute above for the possible values). For every platform
+ <code>databaseType</code> attribute above for the Possible values). For every platform
not in this list, the parameter is ignored. If none is given, then the parameter
is processed for every platform.
</td>
</tr>
+ <tr>
+ <td>value</td>
+ <td>no</td>
+ <td></td>
+ <td></td>
+ <td>The parameter value. If none is given, <code>null</code> is used.</td>
+ </tr>
</table>
</section>
</section>
@@ -270,15 +288,15 @@
<table>
<tr>
<th>Attribute</th>
- <th>Required ?</th>
- <th>Possible values</th>
- <th>Default value</th>
+ <th>Required?</th>
+ <th>Possible values</th>
+ <th>Default value</th>
<th>Meaning</th>
</tr>
<tr>
<td>failOnError</td>
<td>no</td>
- <td>true,false</td>
+ <td>true, false</td>
<td>true</td>
<td>See above.</td>
</tr>
@@ -294,15 +312,15 @@
<table>
<tr>
<th>Attribute</th>
- <th>Required ?</th>
- <th>Possible values</th>
- <th>Default value</th>
+ <th>Required?</th>
+ <th>Possible values</th>
+ <th>Default value</th>
<th>Meaning</th>
</tr>
<tr>
<td>failOnError</td>
<td>no</td>
- <td>true,false</td>
+ <td>true, false</td>
<td>true</td>
<td>See above.</td>
</tr>
@@ -324,15 +342,15 @@
<table>
<tr>
<th>Attribute</th>
- <th>Required ?</th>
- <th>Possible values</th>
- <th>Default value</th>
+ <th>Required?</th>
+ <th>Possible values</th>
+ <th>Default value</th>
<th>Meaning</th>
</tr>
<tr>
<td>alterDatabase</td>
<td>no</td>
- <td>true,false</td>
+ <td>true, false</td>
<td>true</td>
<td>Specifies whether DdlUtils shall alter existing tables rather than dropping them and
creating them new.</td>
@@ -340,7 +358,7 @@
<tr>
<td>doDrops</td>
<td>no</td>
- <td>true,false</td>
+ <td>true, false</td>
<td>true</td>
<td>
Whether tables and external constraints can be dropped if necessary. Note that this is also
@@ -353,7 +371,7 @@
<tr>
<td>failOnError</td>
<td>no</td>
- <td>true,false</td>
+ <td>true, false</td>
<td>true</td>
<td>See above.</td>
</tr>
@@ -370,9 +388,9 @@
<table>
<tr>
<th>Attribute</th>
- <th>Required ?</th>
- <th>Possible values</th>
- <th>Default value</th>
+ <th>Required?</th>
+ <th>Possible values</th>
+ <th>Default value</th>
<th>Meaning</th>
</tr>
<tr>
@@ -384,6 +402,18 @@
for the parameters supported by the individual platforms.</td>
</tr>
<tr>
+ <td>platforms</td>
+ <td>no</td>
+ <td></td>
+ <td></td>
+ <td>
+ Comma-separated list of platforms where the parameter shall be processed (see
+ <code>databaseType</code> attribute above for the Possible values). For every platform
+ not in this list, the parameter is ignored. If none is given, then the parameter
+ is processed for every platform.
+ </td>
+ </tr>
+ <tr>
<td>table</td>
<td>no</td>
<td></td>
@@ -404,18 +434,6 @@
<td></td>
<td>The parameter value. If none is given, <code>null</code> is used.</td>
</tr>
- <tr>
- <td>platforms</td>
- <td>no</td>
- <td></td>
- <td></td>
- <td>
- Comma-separated list of platforms where the parameter shall be processed (see
- <code>databaseType</code> attribute above for the possible values). For every platform
- not in this list, the parameter is ignored. If none is given, then the parameter
- is processed for every platform.
- </td>
- </tr>
</table>
</section>
</section>
@@ -430,29 +448,29 @@
<table>
<tr>
<th>Attribute</th>
- <th>Required ?</th>
- <th>Possible values</th>
- <th>Default value</th>
+ <th>Required?</th>
+ <th>Possible values</th>
+ <th>Default value</th>
<th>Meaning</th>
</tr>
<tr>
<td>alterDatabase</td>
<td>no</td>
- <td>true,false</td>
+ <td>true, false</td>
<td>true</td>
<td>See above.</td>
</tr>
<tr>
<td>doDrops</td>
<td>no</td>
- <td>true,false</td>
+ <td>true, false</td>
<td>true</td>
<td>See above.</td>
</tr>
<tr>
<td>failOnError</td>
<td>no</td>
- <td>true,false</td>
+ <td>true, false</td>
<td>true</td>
<td>See above.</td>
</tr>
@@ -490,17 +508,19 @@
<table>
<tr>
<th>Attribute</th>
- <th>Required ?</th>
- <th>Possible values</th>
- <th>Default value</th>
+ <th>Required?</th>
+ <th>Possible values</th>
+ <th>Default value</th>
<th>Meaning</th>
</tr>
<tr>
- <td>failOnError</td>
+ <td>batchSize</td>
<td>no</td>
- <td>true,false</td>
- <td>true</td>
- <td>See above.</td>
+ <td></td>
+ <td>1</td>
+ <td>The maximum number of insert statements to combine in one batch. The number typically
+ depends on the JDBC driver and the amount of available memory.<br/>
+ This value is only used if <code>useBatchMode</code> is <code>true</code>.</td>
</tr>
<tr>
<td>dataFile</td>
@@ -509,6 +529,24 @@
<td></td>
<td>The name of the single XML file that contains the data to insert into the database.</td>
</tr>
+ <tr>
+ <td>failOnError</td>
+ <td>no</td>
+ <td>true, false</td>
+ <td>true</td>
+ <td>See above.</td>
+ </tr>
+ <tr>
+ <td>useBatchMode</td>
+ <td>no</td>
+ <td>true, false</td>
+ <td>false</td>
+ <td>Whether DdlUtils shall use batch-mode for inserting the data. In this mode, insert statements
+ for the same table are bundled together and executed as one statement which can be a lot
+ faster than single insert statements. To achieve the highest performance, you should group
+ the data in the XML file according to the tables because a batch insert only works for one
+ table which means when the table changes the batch is executed and a new one will be started.</td>
+ </tr>
</table>
<section>
<title>Subelement: fileset</title>
@@ -528,9 +566,9 @@
<table>
<tr>
<th>Attribute</th>
- <th>Required ?</th>
- <th>Possible values</th>
- <th>Default value</th>
+ <th>Required?</th>
+ <th>Possible values</th>
+ <th>Default value</th>
<th>Meaning</th>
</tr>
<tr>
@@ -583,9 +621,9 @@
<table>
<tr>
<th>Attribute</th>
- <th>Required ?</th>
- <th>Possible values</th>
- <th>Default value</th>
+ <th>Required?</th>
+ <th>Possible values</th>
+ <th>Default value</th>
<th>Meaning</th>
</tr>
<tr>
@@ -598,7 +636,7 @@
<tr>
<td>failOnError</td>
<td>no</td>
- <td>true,false</td>
+ <td>true, false</td>
<td>true</td>
<td>See above.</td>
</tr>
@@ -632,16 +670,16 @@
<table>
<tr>
<th>Attribute</th>
- <th>Required ?</th>
- <th>Possible values</th>
- <th>Default value</th>
+ <th>Required?</th>
+ <th>Possible values</th>
+ <th>Default value</th>
<th>Meaning</th>
</tr>
<tr>
<td>catalog</td>
<td>no</td>
<td></td>
- <td>%</td>
+ <td>depends on the database</td>
<td>
Specifies the catalog(s) to access. This is only necessary for some databases.
The pattern is that of
@@ -653,7 +691,7 @@
<td>databaseType</td>
<td>no</td>
<td>axion, cloudscape, db2, derby, firebird, hsqldb, interbase, maxdb, mckoi, mssql,
- mysql, oracle, oracle9, postgresql, sapdb, sybase</td>
+ mysql, mysql5, oracle, oracle9, oracle10, postgresql, sapdb, sybase</td>
<td></td>
<td>
The database type. You should only need to specify this if DdlUtils is not able to
@@ -663,10 +701,22 @@
</td>
</tr>
<tr>
+ <td>modelName</td>
+ <td>no</td>
+ <td></td>
+ <td></td>
+ <td>
+ Specifies the name of the model, e.g. the value of the name attribute in the XML if
+ the <code>writeSchemaToFile</code> sub-task is used. If none is given, DdlUtils
+ will use the schema name as returned by the database, or <code>"default"</code> if
+ the database returned no schema name.
+ </td>
+ </tr>
+ <tr>
<td>schema</td>
<td>no</td>
<td></td>
- <td>%</td>
+ <td>depends on the database</td>
<td>
Specifies the table schema(s) to access. This is only necessary for some databases.
The pattern is that of
@@ -689,8 +739,8 @@
<tr>
<td>useDelimitedSqlIdentifiers</td>
<td>no</td>
- <td>true,false</td>
- <td>true</td>
+ <td>true, false</td>
+ <td>false</td>
<td>
Whether DdlUtils shall use delimited (quoted) identifiers (table names, column names etc.)
In most databases, undelimited identifiers will be converted to uppercase by the database,
@@ -732,9 +782,9 @@
<table>
<tr>
<th>Attribute</th>
- <th>Required ?</th>
- <th>Possible values</th>
- <th>Default value</th>
+ <th>Required?</th>
+ <th>Possible values</th>
+ <th>Default value</th>
<th>Meaning</th>
</tr>
<tr>
@@ -756,29 +806,29 @@
<table>
<tr>
<th>Attribute</th>
- <th>Required ?</th>
- <th>Possible values</th>
- <th>Default value</th>
+ <th>Required?</th>
+ <th>Possible values</th>
+ <th>Default value</th>
<th>Meaning</th>
</tr>
<tr>
<td>alterDatabase</td>
<td>no</td>
- <td>true,false</td>
+ <td>true, false</td>
<td>true</td>
<td>See above.</td>
</tr>
<tr>
<td>doDrops</td>
<td>no</td>
- <td>true,false</td>
+ <td>true, false</td>
<td>true</td>
<td>See above.</td>
</tr>
<tr>
<td>failOnError</td>
<td>no</td>
- <td>true,false</td>
+ <td>true, false</td>
<td>true</td>
<td>See above.</td>
</tr>
Modified: db/ddlutils/trunk/src/doc/src/documentation/content/xdocs/api-usage.xml
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/doc/src/documentation/content/xdocs/api-usage.xml?rev=385311&r1=385310&r2=385311&view=diff
==============================================================================
--- db/ddlutils/trunk/src/doc/src/documentation/content/xdocs/api-usage.xml (original)
+++ db/ddlutils/trunk/src/doc/src/documentation/content/xdocs/api-usage.xml Sun Mar 12 08:29:21 2006
@@ -33,7 +33,7 @@
<p>
Using the appropriate methods on these classes, you can build the
database model manually, or you read it from XML or from the database
- (see the next paragraphs for details). More into about the classes
+ (see the next paragraphs for details). More info about the classes
can be found in the <a href="ext:ddlutils/javadoc/model">javadoc</a>.
</p>
</section>
@@ -90,7 +90,7 @@
{
Platform platform = PlatformFactory.createNewPlatformInstance(dataSource);
- return platform.readModelFromDatabase();
+ return platform.readModelFromDatabase("model");
}]]></source>
</section>
<section>
@@ -134,6 +134,11 @@
platform.createTables(targetModel, true, false);
}
}]]></source>
+ <note>
+ Databases like Oracle allow for more than one separate schema in one database. To cater
+ for these databases, there are variants of these methods where you can specify the
+ catalog and schema.
+ </note>
</section>
<section>
<title>Inserting data into a database</title>