ibatis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgbut...@apache.org
Subject svn commit: r833772 [4/25] - in /ibatis/java/ibator/trunk/core: ./ ibator-core/doc/ ibator-core/doc/html/ ibator-core/doc/html/configreference/ ibator-core/doc/html/generatedobjects/ ibator-core/doc/html/reference/ ibator-core/doc/html/usage/ ibator-ma...
Date Sat, 07 Nov 2009 22:59:05 GMT
Added: ibatis/java/ibator/trunk/core/ibator-core/doc/html/reference/pluggingIn.html
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/doc/html/reference/pluggingIn.html?rev=833772&view=auto
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-core/doc/html/reference/pluggingIn.html (added)
+++ ibatis/java/ibator/trunk/core/ibator-core/doc/html/reference/pluggingIn.html Sat Nov  7 22:59:00 2009
@@ -0,0 +1,122 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Implementing Ibator Plugins</title>
+  <link type="text/css" rel="stylesheet" href="../ibator.css"/>
+</head>
+<body>
+
+<div class="menuNav">
+  <p>
+    <a href="../index.html" target="_top">Show Menu</a>
+    <a href="pluggingIn.html" target="_top">Hide Menu</a>
+  </p>
+</div>
+
+<h1>Implementing Ibator Plugins</h1>
+<p>Ibator plugins can be used to modify or add to the objects that are generated by Ibator.
+Plugins must implement the interface
+<code>org.apache.ibatis.ibator.api.IbatorPlugin</code>.  The plugin interface contains many
+methods that Ibator calls in different phases of the code generation process.  Implementing the
+entire interface is generally not needed for any particular plugin.  Therefore, most plugins should extend
+the adapter class <code>org.apache.ibatis.ibator.api.IbatorPluginAdapter</code>.  The adapter
+class provides basic plugin support, and implements no-operation methods for most of the
+interface methods (similar to Swing adapter classes).</p>
+
+<p>Ibator supplies several plugins (all are in the package
+<code>org.apache.ibatis.ibator.plugins</code>).  The supplied plugins demonstrate
+different types of tasks that can be accomplished with Ibator plugins.  Source
+code for the plugins is available with the Ibator downloads, or can be viewed
+online
+<a target="_blank" href="http://svn.apache.org/repos/asf/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/plugins/">
+here</a>.</p>
+
+<h2>Plugin Lifecycle</h2>
+<p>Plugins have a lifecycle.  Plugins are created during the initialization of the code
+generation process and are called, in order, in different phases of the process.  The following
+list shows the basic lifecycle of a plugin:</p>
+<ol type="1">
+  <li>Plugin created through the default constructor</li>
+  <li><code>setIbatorContext</code> method called</li>
+  <li><code>setProperties</code> method called</li>
+  <li><code>validate</code> method called.  If this method returns <code>false</code>,
+      then no further methods in the plugin will be called</li>
+  <li>For each table in the configuration:
+    <ol type="a">
+      <li><code>initialized</code> method called</li>
+      <li>DAO Methods:<sup>1,2</sup>
+        <ol type="i">
+          <li><code>daoXXXMethodGenerated(Method, TopLevelClass, IntrospectedTable)</code> - these methods
+              are called as each method of the DAO implementation is generated.</li>
+          <li><code>daoImplementationGenerated(TopLevelClass, IntrospectedTable)</code> method called</li>
+          <li><code>daoXXXMethodGenerated(Method, Interface, IntrospectedTable)</code> - these methods
+              are called as each method of the DAO interface is generated.</li>
+          <li><code>daoImplementationGenerated(Interface, IntrospectedTable)</code> method called</li>
+        </ol>
+      </li>
+      <li>Model Methods:<sup>1</sup>
+        <ol type="i">
+          <li><code>modelFieldGenerated</code>, <code>modelGetterMethodGenerated</code>,
+              <code>modelSetterMethodGenerated</code> for each field in the class</li>
+          <li><code>modelExampleClassGenerated(TopLevelClass, IntrospectedTable)</code></li>
+          <li><code>modelPrimaryKeyClassGenerated(TopLevelClass, IntrospectedTable)</code></li>
+          <li><code>modelBaseRecordClassGenerated(TopLevelClass, IntrospectedTable)</code></li>
+          <li><code>modelRecordWithBLOBsClassGenerated(TopLevelClass, IntrospectedTable)</code></li>
+        </ol>
+      </li>
+      <li>SQL Map Methods:<sup>1</sup>
+        <ol type="i">
+          <li><code>sqlMapXXXElementGenerated(XmlElement, IntrospectedTable)</code> - these methods
+              are called as each element of the SQL map is generated</li>
+          <li><code>sqlMapDocumentGenerated(Document, IntrospectedTable)</code></li>
+          <li><code>sqlMapDocument(GeneratedXmlFile, IntrospectedTable)</code></li>
+        </ol>
+      </li>
+      <li><code>contextGenerateAdditionalJavaFiles(IntrospectedTable)</code> method called</li>
+      <li><code>contextGenerateAdditionalXmlFiles(IntrospectedTable)</code> method called</li>
+    </ol>
+  </li>
+  <li><code>contextGenerateAdditionalJavaFiles()</code> method called</li>
+  <li><code>contextGenerateAdditionalXmlFiles()</code> method called</li>
+</ol>
+
+<p><b>Notes:</b><br/>
+<sup>1</sup> - These methods will be called by the Ibator supplied code generators.  If you supply
+ a custom code generator, then these methods will only be called if the custom code generator
+ calls them.<br/>
+<sup>2</sup> - The DAO methods will only be called is a DAO generator is configured.
+</p>
+
+<h2>Coding Plugins</h2>
+<p>The best way to implement a plugin is to extend the
+<code>org.apache.ibatis.ibator.api.IbatorPluginAdapter</code> class and override
+only the specific methods you need in your plugin.</p>
+<p>Methods in the plugin interface can be used to modify code generated by Ibator, or
+to add additional generated code.  Examples of things that can be accomplished with
+plugins are:</p>
+<ul>
+  <li>Add custom annotations to generated methods</li>
+  <li>Add additional methods to a generated class</li>
+  <li>Add additional elements to a generated XML file</li>
+  <li>Generate additional Java files</li>
+  <li>Generate additional XML files</li>
+</ul>
+
+<p>The <code>contextXXX</code> methods will always be called.  Other methods are called
+by the Ibator supplied code generators - and only if the rules for a table would
+cause the generation of a particular element.  For example, the
+<code>modelPrimaryKeyClassGenerated(TopLevelClass, IntrospectedTable)</code>
+method will not be called if the table does not have a primary key.</p>
+
+<p>Methods that return a <code>boolean</code> can be used to bypass code generation.
+If any of these methods return <code>false</code>, then the related item will
+not be added to the generated code.  If there is more than one plugin configured,
+then the first plugin to return false from a method will cause Ibator to stop calling
+that method in all other plugins.</p>
+
+<p>If you have an idea for a plugin, feel free to ask a question about it on
+the iBATIS Java user list.  We're here to help!</p>
+</body>
+</html>

Added: ibatis/java/ibator/trunk/core/ibator-core/doc/html/running.html
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/doc/html/running.html?rev=833772&view=auto
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-core/doc/html/running.html (added)
+++ ibatis/java/ibator/trunk/core/ibator-core/doc/html/running.html Sat Nov  7 22:59:00 2009
@@ -0,0 +1,249 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Running Ibator</title>
+  <link type="text/css" rel="stylesheet" href="ibator.css"/>
+</head>
+<body>
+
+<div class="menuNav">
+  <p>
+    <a href="index.html" target="_top">Show Menu</a>
+    <a href="running.html" target="_top">Hide Menu</a>
+  </p>
+</div>
+
+<h1>Running Ibator</h1>
+<p>Ibator can be run in the following ways:</p>
+<ul>
+  <li>From the command line with an XML configuration</li>
+  <li>As an Ant task with an XML configuration</li>
+  <li>From another Java program with an XML configuration</li>
+  <li>From another Java program with a Java based configuration</li>
+</ul>
+<p>Each method is described in detail below.</p>
+<p><b>Note:</b> there is also an Eclipse
+plugin for Ibator that adds extra function - namely good integration into Eclipse,
+an Eclipse enabled Ant task, and support for automatic merging of
+Java files.  See the
+<a target="_blank" href="http://ibatis.apache.org/ibator.html">Ibator</a>
+home page for information on installing the Eclipse plugin.</p>
+
+<p><b>Important:</b> When running outside of an IDE environment like Eclipse,
+  Ibator interprets the <code>targetProject</code> and
+  <code>targetPackage</code> attributes in all XML configurations as follows:</p>
+<ul>
+  <li><code>targetProject</code> is assumed to be an existing directory structure.
+    Ibator will fail if this directory structure does not exist.</li>
+   <li><code>targetPackage</code> will be translated to a suitable subdirectory
+     structure of the <code>targetProject</code>
+     directory structure.  Ibator will create these subdirectories if necessary.</li>
+</ul>
+
+<h2>Running Ibator from the Command Line</h2>
+<p>Ibator may be run directly from the command line.  The JAR manifest includes the
+   name of the default class (<code>org.apache.ibatis.ibator.api.IbatorRunner</code>)
+   or you may specify it yourself.  The <code>IbatorRunner</code>
+   class accepts several arguments as detailed below:</p>
+<table border="1" cellspacing="0" cellpadding="5">
+<tr>
+  <th>Argument</th>
+  <th>Value</th>
+</tr>
+<tr>
+  <td>-configfile <i>file_name</i> <br/>(required)</td>
+  <td>Specifies the name of the configuration file.</td>
+</tr>
+<tr>
+  <td>-overwrite (optional)</td>
+  <td>If specified, then existing Java files will be overwritten if an existing Java
+      file if found with the same name as a generated file.  If not specified, and a
+      Java file already exists with the same name as a generated file, then Ibator
+      will write the newly generated Java file to the proper directory with a
+      unique name (e.g. MyClass.java.1, MyClass.java.2, etc.).
+      <b>Important: Ibator will always merge and overwrite XML files.</b></td>
+</tr>
+<tr>
+  <td>-verbose (optional)</td>
+  <td>If specified, then Ibator will write progress messages to the console.</td>
+</tr>
+<tr>
+  <td>-forceJavaLogging (optional)</td>
+  <td>If specified, then Ibator will use Java logging rather than Log4J even if
+      Log4J is in the runtime classpath.</td>
+</tr>
+<tr>
+  <td>-contextids <i>context1,context2,...</i><br/>(optional)</td>
+  <td>If specified, then this is a comma delimited list of contexts to use in
+      the current run of Ibator.  Any id specified in the list must exactly
+      match the value of the <code>id</code> attribute of an
+      &lt;ibatorContext&gt; configuration element.  Only ids specified
+      in this list will be active for this run of Ibator.  If this argument
+      is not specified, then all contexts will be active.</td>
+</tr>
+<tr>
+  <td>-tables <i>table1, table2,...</i><br/>(optional)</td>
+  <td>If specified, then this is a comma delimited list of tables to use in
+      the current run of Ibator.  Any table specified in the list must exactly
+      match the fully qualified table name specified in a
+      &lt;table&gt; configuration element.  Only tables specified
+      in this list will be active for this run of Ibator.  If this argument
+      is not specified, then all tables will be active.
+      Specify table names as: <br/><br/>
+      <code>table</code><br/>
+      <code>schema.table</code><br/>
+      <code>catalog..table</code><br/>
+      etc.</td>
+</tr>
+</table>
+
+<p>You must create an Ibator XML configuration file to run Ibator from the
+   command line.  If the file is
+   named "ibatorConfig.xml", then any of the following command lines will run
+   Ibator:</p>
+<pre>
+   java -jar ibator.jar -configfile ibatorConfig.xml
+   java -jar ibator.jar -configfile ibatorConfig.xml -overwrite
+   java -cp ibator.jar org.apache.ibatis.ibator.api.IbatorRunner -configfile ibatorConfig.xml
+   java -cp ibator.jar org.apache.ibatis.ibator.api.IbatorRunner -configfile ibatorConfig.xml -overwrite
+</pre>
+
+<h2>Running Ibator from Ant</h2>
+<p>Ibator includes a simple Ant task.  The task must be defined in your
+  build.xml file, and the task has three parameters.  Here is an example
+  build.xml file:</p>
+<pre>
+   &lt;project default="genfiles" basedir="."&gt;
+     &lt;property name="generated.source.dir" value="${basedir}" /&gt;
+
+     &lt;target name="genfiles" description="Generate the files"&gt;
+       &lt;taskdef name="ibator"
+                classname="org.apache.ibatis.ibator.ant.IbatorAntTask"
+                classpath="ibator.jar" /&gt;
+       &lt;ibator overwrite="true" configfile="ibatorConfig.xml" verbose="false" &gt;
+         &lt;propertyset&gt;
+           &lt;propertyref name="generated.source.dir"/&gt;
+         &lt;/propertyset&gt;
+       &lt;/ibator&gt;
+     &lt;/target&gt;
+   &lt;/project&gt;
+</pre>
+
+<p>Ibator task attributes are as follows:</p>
+<table border="1" cellspacing="0" cellpadding="5">
+<tr>
+  <th>Attribute</th>
+  <th>Value</th>
+</tr>
+<tr>
+  <td>configfile (required)</td>
+  <td>Specifies the name of the configuration file.</td>
+</tr>
+<tr>
+  <td>overwrite (optional)</td>
+  <td>If "true", "yes", etc., then existing Java files will be overwritten if an existing Java
+      file if found with the same name as a generated file.  If "false", "no", etc., and a
+      Java file already exists with the same name as a generated file, then Ibator
+      will write the newly generated Java file to the proper directory with a
+      unique name (e.g. MyClass.java.1, MyClass.java.2, etc.).
+      <b>Important: Ibator will always merge and overwrite XML files.</b></td>
+</tr>
+<tr>
+  <td>contextids (optional)</td>
+  <td>If specified, then this is a comma delimited list of contexts to use in
+      the current run of Ibator.  Any id specified in the list must exactly
+      match the value of the <code>id</code> attribute of an
+      &lt;ibatorContext&gt; configuration element.  Only ids specified
+      in this list will be active for this run of Ibator.  If this argument
+      is not specified, then all contexts will be active.</td>
+</tr>
+<tr>
+  <td>tables (optional)</td>
+  <td>If specified, then this is a comma delimited list of tables to use in
+      the current run of Ibator.  Any table specified in the list must exactly
+      match the fully qualified table name specified in a
+      &lt;table&gt; configuration element.  Only tables specified
+      in this list will be active for this run of Ibator.  If this argument
+      is not specified, then all tables will be active.
+      Specify table names as: <br/><br/>
+      <code>table</code><br/>
+      <code>schema.table</code><br/>
+      <code>catalog..table</code><br/>
+      etc.</td>
+</tr>
+<tr>
+  <td>verbose (optional)</td>
+  <td>If "true", "yes", etc., then Ibator will log progress messages to the
+      ant console (if Ant is running in verbose mode).  The default is "false".</td>
+</tr>
+</table>
+
+<p>Notes:</p>
+<ul>
+  <li>The classpath on the &lt;taskdef&gt; is used to tell Ant where the Ibator JAR file
+     is.  This is optional if you add Ibator to the Ant classpath in one
+     of the other ways described in the Ant manual</li>
+   <li>The name of the task can be anything you desire, "ibator" is
+     simply an example</li>
+   <li>The task supports an optional nested <code>&lt;propertyset&gt;</code> element which
+       is the standard Ant property set type.  This can be used to pass parameters into
+       a configuration file.  For example, the above property
+       <code>generated.source.dir</code> can be
+       accessed in the Ibator configuration file with the escape sequence
+       <code>${generated.source.dir}</code>
+   </li>
+   <li>If a property is specified in the configuration file and is not resolved,
+       then the escaped property string will be passed "as is" into the generated code.
+   </li>
+</ul>
+
+<h2>Running Ibator from Java with an XML Configuration File</h2>
+<p>The following code sample shows how to call Ibator from Java.  It does not
+   show exception handling, but that should be obvious from the compiler
+   errors :)</p>
+<pre>
+   List&lt;String&gt; warnings = new ArrayList&lt;String&gt;();
+   boolean overwrite = true;
+   File configFile = new File("ibatorConfig.xml");
+   IbatorConfigurationParser cp = new IbatorConfigurationParser(warnings);
+   IbatorConfiguration config = cp.parseIbatorConfiguration(configFile);
+   DefaultShellCallback callback = new DefaultShellCallback(overwrite);
+   Ibator ibator = new Ibator(config, callback, warnings);
+   ibator.generate(null);
+</pre>
+
+<p>Notes:</p>
+<ul>
+   <li>Configuration file properties may be passed to the parser as a parameter on
+       the IbatorConfigurationParser constructor.  If not passed explicitly, the JVM
+       system properties will be searched for the value of configuration file
+       properties.  For example, the property
+       <code>generated.source.dir</code> can be
+       accessed in the Ibator configuration file with the escape sequence
+       <code>${generated.source.dir}</code>
+   </li>
+   <li>If a property is specified in the configuration file and is not resolved,
+       then the escaped property string will be passed "as is" into the generated code.
+   </li>
+</ul>
+
+<h2>Running Ibator from Java with a Java Based Configuration</h2>
+<p>The following code sample shows how to call Ibator from Java only.  It does
+   not show exception handling, but that should be obvious from the compiler
+   errors :)</p>
+<pre>
+   List&lt;String&gt; warnings = new ArrayList&lt;String&gt;();
+   boolean overwrite = true;
+   IbatorConfiguration config = new IbatorConfiguration();
+
+   //   ... fill out the config object as appropriate...
+
+   DefaultShellCallback callback = new DefaultShellCallback(overwrite);
+   Ibator ibator = new Ibator(config, callback, warnings);
+   ibator.generate(null);
+</pre>
+
+</body>
+</html>
\ No newline at end of file

Added: ibatis/java/ibator/trunk/core/ibator-core/doc/html/usage/db2.html
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/doc/html/usage/db2.html?rev=833772&view=auto
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-core/doc/html/usage/db2.html (added)
+++ ibatis/java/ibator/trunk/core/ibator-core/doc/html/usage/db2.html Sat Nov  7 22:59:00 2009
@@ -0,0 +1,31 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Ibator DB2 Usage Notes</title>
+  <link type="text/css" rel="stylesheet" href="../ibator.css"/>
+</head>
+<body>
+
+<div class="menuNav">
+  <p>
+    <a href="../index.html" target="_top">Show Menu</a>
+    <a href="db2.html" target="_top">Hide Menu</a>
+  </p>
+</div>
+
+<h1>Ibator DB2 Usage Notes</h1>
+<h2>LONG VARCHAR Fields</h2>
+<p>By default Ibator will map LONG VARCHAR fields to the <code>java.lang.String</code> data type,
+and will mark these fields as <code>jdbcType="LONGVARCHAR"</code>.  This
+mapping will cause errors when retrieving data from DB2.  DB2 LONG VARCHAR fields should be mapped
+to the <code>java.lang.String</code> data type with <code>jdbcType="VARCHAR"</code>.  To overcome
+this problem, use a <code>&lt;columnOverride&gt;</code> as follows:</p>
+<pre>
+  &lt;table schema="DB2ADMIN" tableName="ALLTYPES" &gt;
+    &lt;columnOverride column="LONG_VARCHAR_FIELD" javaType="java.lang.String" jdbcType="VARCHAR" /&gt;
+  &lt;/table&gt;
+</pre>
+</body>
+</html>

Added: ibatis/java/ibator/trunk/core/ibator-core/doc/html/usage/intro.html
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/doc/html/usage/intro.html?rev=833772&view=auto
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-core/doc/html/usage/intro.html (added)
+++ ibatis/java/ibator/trunk/core/ibator-core/doc/html/usage/intro.html Sat Nov  7 22:59:00 2009
@@ -0,0 +1,31 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Ibator Usage Notes</title>
+  <link type="text/css" rel="stylesheet" href="../ibator.css"/>
+</head>
+<body>
+
+<div class="menuNav">
+  <p>
+    <a href="../index.html" target="_top">Show Menu</a>
+    <a href="intro.html" target="_top">Hide Menu</a>
+  </p>
+</div>
+
+<h1>Ibator Usage Notes</h1>
+<p>This section collects usage information for different databases.</p>
+
+<ul>
+  <li><a href="db2.html">DB2</a></li>
+  <li><a href="mysql.html">MySql</a></li>
+  <li><a href="oracle.html">Oracle</a></li>
+  <li><a href="postgresql.html">PostgreSQL</a></li>
+</ul>
+<p>Please let us know about any quirks you discover for the database you are using - we will
+be happy to add the information
+to this section for future reference.</p>
+</body>
+</html>

Added: ibatis/java/ibator/trunk/core/ibator-core/doc/html/usage/mysql.html
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/doc/html/usage/mysql.html?rev=833772&view=auto
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-core/doc/html/usage/mysql.html (added)
+++ ibatis/java/ibator/trunk/core/ibator-core/doc/html/usage/mysql.html Sat Nov  7 22:59:00 2009
@@ -0,0 +1,34 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Ibator MySql Usage Notes</title>
+  <link type="text/css" rel="stylesheet" href="../ibator.css"/>
+</head>
+<body>
+
+<div class="menuNav">
+  <p>
+    <a href="../index.html" target="_top">Show Menu</a>
+    <a href="mysql.html" target="_top">Hide Menu</a>
+  </p>
+</div>
+
+<h1>Ibator MySql Usage Notes</h1>
+<h2>Unsigned Fields</h2>
+<p>MySql supports both signed, and unsigned, numeric fields.  These are not JDBC types, so Ibator
+cannot automatically account for these types of fields.  The Java data types are always signed.
+This can
+lead to a loss of precision when using unsigned fields.  The solution is to provide a
+<code>&lt;columnOverride&gt;</code> for any unsigned numeric field in MySql.  Here is an example
+of how to deal with an unsigned bigint field in MySql:</p>
+<pre>
+  &lt;table tableName="ALLTYPES" &gt;
+    &lt;columnOverride column="UNSIGNED_BIGINT_FIELD" javaType="java.lang.Object" jdbcType="LONG" /&gt;
+  &lt;/table&gt;
+</pre>
+<p>You will have to cast the returned value to the appropriate type yourself (in this case,
+<code>java.math.BigInteger</code>).</p>
+</body>
+</html>

Added: ibatis/java/ibator/trunk/core/ibator-core/doc/html/usage/oracle.html
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/doc/html/usage/oracle.html?rev=833772&view=auto
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-core/doc/html/usage/oracle.html (added)
+++ ibatis/java/ibator/trunk/core/ibator-core/doc/html/usage/oracle.html Sat Nov  7 22:59:00 2009
@@ -0,0 +1,33 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Ibator Oracle Usage Notes</title>
+  <link type="text/css" rel="stylesheet" href="../ibator.css"/>
+</head>
+<body>
+
+<div class="menuNav">
+  <p>
+    <a href="../index.html" target="_top">Show Menu</a>
+    <a href="oracle.html" target="_top">Hide Menu</a>
+  </p>
+</div>
+
+<h1>Ibator Oracle Usage Notes</h1>
+<h2>Public Synonyms</h2>
+<p>If you want to generate objects for a table that has a public synonym, you
+should actually generate the objects against the real table - and then change the
+table name at runtime.  Ibator supports this automatically.</p>
+<p>For example, assume there is a public alias "FRED" that points to the
+table "HR.EMPLOYEES".  The following table configuration will generate the objects
+based on HR.EMPLOYEES, but the runtime SQL will only refer to FRED:</p>
+<pre>
+  &lt;table schema="HR" tableName="EMPLOYEES"&gt;
+    &lt;property name="ignoreQualifiersAtRuntime" value="true" /&gt;
+    &lt;property name="runtimeTableName" value="FRED" /&gt;
+  &lt;/table&gt;
+</pre>
+</body>
+</html>

Added: ibatis/java/ibator/trunk/core/ibator-core/doc/html/usage/postgresql.html
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/doc/html/usage/postgresql.html?rev=833772&view=auto
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-core/doc/html/usage/postgresql.html (added)
+++ ibatis/java/ibator/trunk/core/ibator-core/doc/html/usage/postgresql.html Sat Nov  7 22:59:00 2009
@@ -0,0 +1,48 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Ibator PostgreSQL Usage Notes</title>
+  <link type="text/css" rel="stylesheet" href="../ibator.css"/>
+</head>
+<body>
+
+<div class="menuNav">
+  <p>
+    <a href="../index.html" target="_top">Show Menu</a>
+    <a href="postgresql.html" target="_top">Hide Menu</a>
+  </p>
+</div>
+
+<h1>Ibator PostgreSQL Usage Notes</h1>
+<h2>Case Sensitivity</h2>
+<p>PostgreSQL is case sensitive with regards to all database identifiers
+(table names, schema names, column names, etc.)  In addition, PostgreSQL
+has a distinct preference for all identifiers being in all lower case letters.
+If you use all lower case identifiers for PostgreSQL, then Ibator will find tables
+and write correct SQL with no additional consideration.  If you used mixed cased,
+or upper case, identifiers you will
+need to configure Ibator appropriately:</p>
+<ul>
+  <li>Use the <code>delimitIdentifiers</code> option if your table or schema
+      is mixed case or all upper case.</li>
+  <li>For each mixed case or upper case column you could specify a
+      <code>&lt;columnOverride&gt;</code> element to specifically delimit the column,
+      or you could specify the <code>delimitAllColumns</code> attribute
+      to delimit all column names.</li>
+</ul>
+<p>Examples:</p>
+<pre>
+  &lt;table schema="HR" tableName="Employees"
+      delimitIdentifiers="true" delimitAllColumns="true"/&gt;
+</pre>
+<p>Or...</p>
+<pre>
+  &lt;table schema="HR" tableName="Employees" delimitIdentifiers="true" &gt;
+    &lt;columnOverride column="EmployeeId" delimitedColumnName="true" /&gt;
+    &lt;columnOverride column="EmployeeName" delimitedColumnName="true" /&gt;
+  &lt;/table&gt;
+</pre>
+</body>
+</html>

Added: ibatis/java/ibator/trunk/core/ibator-core/doc/html/whatsNew.html
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/doc/html/whatsNew.html?rev=833772&view=auto
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-core/doc/html/whatsNew.html (added)
+++ ibatis/java/ibator/trunk/core/ibator-core/doc/html/whatsNew.html Sat Nov  7 22:59:00 2009
@@ -0,0 +1,460 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>What's New in Ibator</title>
+  <link type="text/css" rel="stylesheet" href="ibator.css"/>
+</head>
+<body>
+
+<div class="menuNav">
+  <p>
+    <a href="index.html" target="_top">Show Menu</a>
+    <a href="whatsNew.html" target="_top">Hide Menu</a>
+  </p>
+</div>
+
+<h1>What's New in Ibator</h1>
+<h2>Version 1.2.2</h2>
+<h3>Announcements</h3>
+<ul>
+  <li>The <code>org.apache.ibatis.ibator.api.CommentGenerator</code> interface
+      has changed.  Classes that implement this interface <b>must be changed</b>.  With
+      this change, implementing classes have access to many more data elements
+      from which to generate comments.  Additionally, this change makes the comment
+      generator interface more consistent with the other public Ibator interfaces.
+      Details of the change follow:
+      <ul>
+        <li>Methods which accepted the parameter <code>FullyQualifiedTable</code>
+            now accept the parameter <code>IntrospectedTable</code> instead.
+            The <code>FullyQualifiedTable</code> instance is available through
+            the method <code>IntrospectedTable.getFullyQualifiedTable()</code>.
+        </li>
+        <li>Methods which accepted the <code>String</code> parameter <code>columnName</code>
+            now accept the parameter <code>IntrospectedColumn</code> instead.
+            The column name is available through
+            the method <code>IntrospectedColumn.getActualColumnName()</code>.
+        </li>
+      </ul>
+      <p><b>Important Note:</b> any implementation that subclasses the Ibator
+      supplied class <code>DefaultCommentGenerator</code> does not need to
+      change immediately with this release.
+      The old methods have been deprecated and will be removed with the next
+      release of Ibator - so subclasses should be reworked as soon as
+      convenient.</p>
+  </li>
+  <li>The SQL Map generator has changed in that it no longer prepends the string
+      "ibatorgenerated_" to every generated XML id.  If you were relying on these
+      generated names in other code, you can force Ibator to prepend the string
+      with the property <code>useLegacyXMLIds</code> on the
+      <a href="configreference/sqlMapGenerator.html">&lt;SqlMapGenerator&gt;</a> configuration.</li>
+
+</ul>
+<h3>Bugs Fixed</h3>
+<ul>
+  <li>NPE when no DAOs are generated.</li>
+  <li>IBATIS-579 - Don't allow column names that contain spaces to
+      break across lines in generated XML.</li>
+  <li>Fixed NPE and incorrect calculation in generated equals method
+      (from EqualsHashCodePlugin) when certain
+      fields are null - thanks to Benjamin Klatt for finding this bug.</li>
+  <li>IBATIS-601 - improper validation of &lt;generatedKey&gt;</li>
+  <li>IBATIS-609 - incorrect parsing of Java generic types</li>
+</ul>
+
+<h3>Enhancements</h3>
+<ul>
+  <li>IBATIS-569 - Modified the IbatorRules implementation to make it easier
+      for plugins to provide custom implementations of IbatorRules.  See the
+      Javadoc for the new class
+      <code>org.apache.ibatis.ibator.internal.rules.IbatorRulesDelegate</code>
+      for more information.</li>
+  <li>IBATIS-571 - Added support for automatically delimiting SQL keywords
+      if they are used as column names in tables.  See the
+      <a href="configreference/ibatorContext.html">&lt;ibatorContext&gt;</a> page
+      for more information.</li>
+  <li>IBATIS-577 - Define SQL fragments for column lists to improve
+      reusability of generated code.  Thanks to Iwao AVE! for the idea
+      and the initial patch.
+  </li>
+  <li>Added new <code>-verbose</code> command line argument.  See the
+     <a href="running.html">Running Ibator</a> page
+      for more information.</li>
+  <li>Added logging statements for use in debug. See the
+     <a href="reference/logging.html">Logging</a> page
+      for more information.</li>
+  <li>Added new example plugin to demonstrate adding case insensitive LIKE
+      support to generated Example classes.  See the
+     <a href="configreference/ibatorPlugin.html">&lt;ibatorPlugin&gt;</a> page
+      for more information.</li>
+  <li>Added "delimitAllColumns" attribute to table configurations.  This supports databases
+      like PosgreSQL that are case sensitive for identifiers. See the
+     <a href="configreference/table.html">&lt;table&gt;</a> page
+      for more information.</li>
+  <li>Added a page explaining how to deal with case sensitivity in PostgreSQL.  See the
+     <a href="usage/postgresql.html">PostgreSQL</a> page
+      for more information.</li>
+  <li>IBATIS-586 - Added the ability to specify nested property elements on columnOverrides.
+      See the <a href="configreference/columnOverride.html">&lt;columnOverride&gt;</a> page
+      for more information. Thanks to Dan Turkenkopf for the idea and a nice initial patch.</li>
+  <li>The IntrospectedColumn class now contains any column remarks returned during
+      database introspection. This may be useful for some CommentGenerators.</li>
+  <li>IBATIS-592 - Added attributes to IntrospectedTable that contain the calculated
+      SqlMap namespace, and the calculated runtime table names.  These can now be overridden in
+      plugins.</li>
+  <li>Fixed addCriterionfor JDBC* methods so that they all do a null check.</li>
+  <li>Fixed IbatorRunner so that configuration errors are shown (thanks to Karel Rank)</li>
+  <li>IBATIS-605 - Added Informix Dialect for
+      <a href="configreference/generatedKey.html">&lt;generatedKey&gt;</a></li>
+</ul>
+
+<h2>Version 1.2.1</h2>
+<h3>Bugs Fixed</h3>
+<ul>
+  <li>Fixed the IbatorObjectFactory so it will find internal classes from the context classloader.</li>
+  <li>Fixed IBATIS-565 - ill formed comment in the SqlMapConfigPlugin</li>
+</ul>
+
+<h3>Enhancements</h3>
+<ul>
+  <li>Modified plugin methods for model fields, getters, and setters so that
+   the plugin will know which type of class (Primary Key, Base Record, or
+   Record with BLOBs) is being generated.</li>
+  <li>Added methods to IntrospectedTable to get/set attributes.  This
+      allows plugin classes to maintain table based state between
+      plugin calls.</li>
+  <li>Added <code>initialized</code> method to the plugin API.  This
+      allows plugins to alter some of the fundamental code generation items
+      (like the name of a generated class, for example).</li>
+  <li>Added an example plugin to show usage of the <code>initialized</code>
+      method.</li>
+</ul>
+
+<h2>Version 1.2.0</h2>
+<h3>Announcements</h3>
+<ul>
+  <li>With version 1.2, Abator is renamed to Apache iBATIS Ibator.  Several changes
+      have been made to the XML configuration as well as the Java API.  See the
+      <a href="migratingFromAbator.html">Migrating from Abator</a> page for detailed
+      information about changes needed to existing Abator configuration files.</li>
+</ul>
+
+<h3>Bugs Fixed</h3>
+<ul>
+  <li>Fixed the JavaTypeResolver so that columns with unsupported data types
+      may be overridden by configuration.</li>
+  <li>Fixed IBATIS-523 - a bug in the pre-release version of the EqualsHashCodePlugin</li>
+  <li>Fixed IBATIS-542 - upgrade the build to Ant version 1.7.1</li>
+</ul>
+
+<h3>Enhancements</h3>
+<ul>
+  <li>Ibator now includes a plugin mechanism.  This mechanism can be used to
+      add to or modify the code generated by Ibator.  If you have previously
+      extended one of Abator's code generators to change their behavior, we
+      strongly suggest that you move to a plugin.  See the
+      <a href="configreference/ibatorPlugin.html">&lt;ibatorPlugin&gt;</a> page
+      for detailed information.</li>
+  <li>Ibator ships with the following plugins:
+    <ul>
+      <li>A plugin that will generate an SQL Map Config File
+        (<code>org.apache.ibatis.ibator.plugins.SqlMapConfigPlugin</code>)
+      </li>
+      <li>A plugin that will make generated model classes Serializable
+        (<code>org.apache.ibatis.ibator.plugins.SerializablePlugin</code>)
+      </li>
+      <li>A plugin that will add <code>equals</code> and <code>hashCode</code>
+        methods to generated model classes
+        (<code>org.apache.ibatis.ibator.plugins.EqualsHashCodePlugin</code>)
+      </li>
+    </ul>
+  </li>
+  <li>Added support for "runtimeCatalog" and "runtimeSchema" properties to the
+      <a href="configreference/table.html">&lt;table&gt;</a>
+      configuration element.  Thanks to Dan Turkenkopf for the idea and the
+      patch!</li>
+  <li>New generated method - insertSelective.  This method will allow you to use
+      column defaults on a table definition on insert</li>
+  <li>Added the ability to specify a that DAO implementation classes be in a
+      separate package from the DAO interface classes.</li>
+</ul>
+
+<h3>Changes from Abator</h3>
+<p>There are several breaking changes between Ibator and Abator.  This list
+details the changes, and has methods of resolving the differences.</p>
+<ul>
+  <li>JSE 5.0 or higher is required for Ibator</li>
+  <li>Ibator does not contain the "legacy" code generators from Abator.  You must
+      choose "Ibatis2Java2" or "Ibatis2Java5" as a target runtime - and code generated from
+      Ibator is compatible with iBATIS version 2.2.0 or higher only.  If you are
+      using an earlier version of iBATIS - upgrade!  If you are not able to upgrade,
+      then you must continue to use Abator.</li>
+  <li>The classloading strategy in Ibator is changed from Abator.  In all cases, we now recommend
+      specifying the classpath external to Ibator and we further recommend that you do not use
+      the <code>&lt;classPathEntry&gt;</code> element.  You may specify classpath entries
+      if you feel you must, but those entries will only be used when loading JDBC drivers
+      of Java model root classes.  If you write a custom extension to Ibator, or a plugin,
+      you must specify that classpath entry external to Ibator.</li>
+  <li>The API for extending Ibator is significantly changed from Abator.
+      In most cases, implementations of the old Abator interfaces should
+      be converted to Ibator plugins.  See the
+      <a href="reference/extending.html">Extending Ibator</a> for more information.</li>
+  <li>The <code>afterXXXGenerationHook</code> methods have been removed from
+      all Ibator supplied implementations of the core interfaces.  If you
+      were extending an Ibator supplied implementation to make use of these methods,
+      then you <em>must</em> migrate your code to an Ibator plugin.</li>
+  <li>The build has been significantly modified and now includes an Emma based
+      code coverage report.</li>
+  <li>Changes to the XML configuration file are required.  See the
+      <a href="migratingFromAbator.html">Migrating from Abator</a> page for detailed
+      information</li>
+</ul>
+
+<h2>Version 1.1.0</h2>
+<h3>Announcements</h3>
+<ul>
+  <li>The next release of Abator will require JRE 5.0 or higher.</li>
+  <li>Java2 is now the default generator set.  This will cause different code to be
+      generated if you have not specified a generator set previously.  To remedy this,
+      set the generator set to "Legacy".</li>
+</ul>
+
+<h3>New Generated Methods</h3>
+<p>Abator will generate these new methods:</p>
+<dl>
+  <dt><b>countByExample</b></dt>
+  <dd>This method will return an integer representing the number of rows in a table
+      that match the given criteria.</dd>
+  <dt><b>updateByExample</b></dt>
+  <dd>This method will update all rows in a table that match a given criteria.  This method is
+      available in the Java2 and Java5 generator sets only.  There is also a "selective" version
+      of the method that only updates certain columns of a table (the selective version of this
+      method is probably the more useful version to use in most situations).</dd>
+</dl>
+
+<h3>Bugs Fixed</h3>
+<ul>
+  <li>Fixed bug for corner case where a criteria class is created, but no criteria
+      are set.</li>
+  <li>Fixed a bug that caused the JavaModelGenerator's "trimStrings" property to fail</li>
+  <li>Fixed the XML file merger so that internal entities are preserved</li>
+  <li>Fixed the XML configuration parser so that external entities are handled properly</li>
+  <li>Fixed bug - incorrect datatype mapping for JDBC BIT datatype</li>
+  <li>Fixed bug where Abator generated incorrect properties for certain database columns
+      (for example, if the column name is I_NAME)</li>
+</ul>
+
+<h3>Miscellaneous Changes</h3>
+<ul>
+  <li>Added the ability to specify properties to ignore qualifiers and change runtime
+      table names in the generated SQL for a table.  Primary use cases for this
+      support include:
+      <ul>
+        <li>Generating objects for a table that has a public synonym or alias</li>
+        <li>Generating objects for a table that exists in many schemas, and the
+            schema will be selected at runtime</li>
+      </ul>
+    See the <a href="configreference/table.html">&lt;table&gt;</a>
+    reference page for more information, or the
+    <a href="usage/oracle.html">Oracle</a> reference page for an example.</li>
+  <li>Added support for delimiting SQL identifiers for the use cases where identifiers
+      contain spaces or SQL reserved words.
+      See the <a href="configreference/table.html">&lt;table&gt;</a>,
+      <a href="configreference/abatorContext.html">&lt;abatorContext&gt;</a>,
+      and <a href="configreference/columnOverride.html">&lt;columnOverride&gt;</a>
+      reference pages for more information.</li>
+  <li>Added SYBASE dialect for generated keys.
+      See the <a href="configreference/generatedKey.html">&lt;generatedKey&gt;</a>
+      reference page for more information.</li>
+  <li>Added DB2_MF (DB2 on Main Frames) dialect for generated keys.
+      See the <a href="configreference/generatedKey.html">&lt;generatedKey&gt;</a>
+      reference page for more information.</li>
+  <li>Abator will now automatically escape identifiers that contain the $ or # characters
+      as these characters have special meaning in iBATIS configuration files.</li>
+  <li>Added a <code>clear</code> method to the generated example classes (in the Java2 and Java5
+      generator sets only).  This allows reuse of these classes.</li>
+  <li>Added the ability to specify that result maps should use column indexes rather
+      than column names in the result mappings.  Primary use cases for this
+      support include:
+      <ul>
+        <li>When tables have columns whose name is only differentiated by
+            case (e.g. "first name" and "First Name")</li>
+        <li>When you want to make the selects as fast as possible (there is a slight
+            performance benefit when using column indexes)</li>
+      </ul>
+    See the <a href="configreference/table.html">&lt;table&gt;</a>
+    reference page for more information.</li>
+  <li>Made the generated Example and Criteria classes extendable.  Added some documentation
+      about how to extend these classes.  See the
+      <a href="generatedobjects/extendingExampleClass.html">Extending the Example Classes</a>
+      reference page for more information.</li>
+  <li>Made the legacy DAOs extendable.</li>
+  <li>Added the ability to provide a renaming rule for columns.  This is for the
+      use case where columns have a common prefix that should be removed before
+      calculating the property name.  See the
+      <a href="configreference/columnRenamingRule.html">&lt;columnRenamingRule&gt;</a>
+      reference page for more information.</li>
+  <li>Added support for persisting a configuration to XML - this to enable
+      a graphical editor in the future.</li>
+  <li>Add afterXXXGenerationHook() methods in all generators to enable adding
+      extra Java code or XML elements to any generated object.  This will make
+      it easier to create customized generators.</li>
+  <li>API change to allow generating with selected contexts rather than
+      the entire config file.</li>
+  <li>API change to allow generating with selected tables rather than
+    the entire config file.</li>
+  <li>Exposed new support for selecting tables and/or contexts to the
+      command line and the Ant task - this has added an advanced syntax to the command
+      line for Abator.  See the
+      <a href="running.html">Running Abator</a> reference page for more information.</li>
+  <li><code>rootClass</code> and <code>rootInterface</code> may now be specified for each table.
+      See the <a href="configreference/table.html">&lt;table&gt;</a>
+      reference page for more information.</li>
+  <li>If a <code>rootClass</code> is specified for any table, Abator will now check in the
+      rootClass to see if a generated property already exists in the root class.  If it does,
+      Abator will not generate the property.  The &lt;javaModelGenerator&gt; element now
+      accepts a property to specify the classpath of the <code>rootClass</code>.  See the
+      <a href="configreference/javaModelGenerator.html">&lt;javaModelGenerator&gt;</a>
+      reference page for more information.  Thanks to Ashok Madhavan for the beginnings
+      of this code.</li>
+  <li>Allowed specifying a type (pre or post) for the generated key element.  See the
+      <a href="configreference/generatedKey.html">&lt;generatedKey&gt;</a>
+      reference page for more information.</li>
+  <li>Added a comment generator interface to enable generation of custom comments.
+      See the <a href="configreference/commentGenerator.html">&lt;commentGenerator&gt;</a>
+      reference page for more information.</li>
+</ul>
+
+<h2>Version 1.0.0</h2>
+<h3>Generator Sets</h3>
+<p>A generator set is a set of
+code generators (SQL Map Generator, Java Model Generator, DAO Generator, and Java Type Resolver).
+Abator now ships three different generator sets.  The generated code from these three
+generator sets is slightly different, and the use of the generated objects is slightly
+different too.  The concepts are exactly the same.  With the newer generator sets, the
+"by example" methods have been vastly improved.  It is now possible to generate
+<b>virtually any</b> WHERE clause (including IN and BETWEEN predicates).  Lastly, the new
+generator sets generate much more concise code - the DAOs and SQL Maps are of
+normal size, and there are no extraneous methods.  The example class in the new generator
+sets encapsulates all the function needed to generate dynamic queries.</p>
+<p>The three generator sets shipped with Abator are as follows:</p>
+<dl>
+  <dt>Legacy</dt>
+  <dd>This generator set generates code that is the same as previous versions of
+      Abator.  There are some limitations with this generator set and we strongly
+      recommend that you choose one of the other sets.  However, this set remains
+      the default for now.  <b>This generator set will likely be removed in a future
+      version of Abator.</b></dd>
+  <dt>Java2</dt>
+  <dd>This generator set generates code that is compatible with iBATIS versions 2.2.0 and
+      higher.  With this generator set the "by example" methods are much more powerful
+      than in the legacy set.  It is now possible to generate
+      virtually unlimited SQL WHERE clauses with Abator generated code (including "IN"
+      and "BETWEEN" clauses).  <b>This generator set will likely become the default set in a
+      future version of Abator.</b></dd>
+  <dt>Java5</dt>
+  <dd>This generator set has the same capabilities as the Java2 generator set with the
+      added feature of generating code that is JSE 5.0 compliant using parameterized
+      types and annotations.</dd>
+</dl>
+<p><b>Important:</b> code generated with the Java2 or Java5 generator sets is not 100%
+compatible with code generated with the Legacy set - especially in the use of the
+"by example" methods.  Also note that the "by example" methods in these generator sets rely
+on iBATIS dynamic SQL support that is missing in iBATIS versions prior to version 2.2.0.</p>
+<p>A generator set is selected with the <code>generatorSet</code> attribute of the
+<code>&lt;abatorContext&gt;</code> element.  See the
+<a href="configreference/abatorContext.html">&lt;abatorContext&gt;</a> reference page for
+more information.</p>
+
+<p>Use of the example classes is different with the different generator sets.  See the
+<a href="generatedobjects/exampleClassUsage.html">Example Class Usage</a> page for more
+information.</p>
+
+<h3>Model Types</h3>
+<p>A model type is used to give you more control over the types of domain objects
+generated by Abator.  Abator now supports three different types of domain models
+as follows:</p>
+<dl>
+  <dt>conditional</dt>
+  <dd>This model is similar to the hierarchical model except that a separate
+    class will not be generated if that separate class would only contain
+    one field.  So if a table has only one primary key field, that field
+    will be merged into the base record class.  This model type is the default.
+    <b>Note that this model type may generate classes that are not 100%
+    with classes generated in previous versions of Abator.</b></dd>
+  <dt>flat</dt>
+  <dd>This model generates only one domain class for any table.  The class
+     will hold all fields in the table.</dd>
+  <dt>hierarchical</dt>
+  <dd>This model is the same as the model shipped with the initial versions
+      of Abator.  This model will generate a primary key class if the table has
+      a primary key, another class that holds any BLOB columns in the table, and
+      another class that holds the remaining fields.  There is an appropriate
+      inheritance relationship between the classes.</dd>
+</dl>
+
+<p>Model types can be specified as a default for an entire context, and you may
+override the default for each table in a context.  See the
+<a href="configreference/abatorContext.html">&lt;abatorContext&gt;</a> reference page for
+more information about setting the context default..
+See the <a href="configreference/table.html">&lt;table&gt;</a>
+reference page for more information about setting a model type for specific tables.
+</p>
+<p><b>Important:</b> the default value is conditional - this is a non-backward compatible
+change from previous versions of Abator.</p>
+
+<h3>updateByPrimaryKeySelective</h3>
+<p>This is a new mapped SQL statement, and new DAO method, that will only
+update columns whose corresponding properties in the parameter class are non-null.
+This can be used to update certain
+columns in a record without needing to update the entire record.
+</p>
+<p><b>Important:</b> any column that is mapped to a primitive type
+will always be updated.</p>
+
+<h3>Miscellaneous Changes</h3>
+<ul>
+  <li>Added the ability to specify a table alias.  This aids in reuse of generated
+    SQL map elements.  See the <a href="configreference/table.html">&lt;table&gt;</a>
+    reference page for more information.</li>
+  <li>Fixed the XML file merger so that extraneous blank lines at the end of the
+      file are removed.</li>
+  <li>Added the ability to specify a type handler for table columns.
+    See the <a href="configreference/columnOverride.html">&lt;columnOverride&gt;</a>
+    reference page for more information.</li>
+  <li>Added the ability to specify the visibility of the DAO "by example" methods.
+    This allows you to make the methods private for internal use only.
+    See the <a href="configreference/daoGenerator.html">&lt;daoGenerator&gt;</a>
+    reference page for more information.</li>
+  <li>Added the ability to override the naming convention for DAO method names.
+    See the <a href="configreference/daoGenerator.html">&lt;daoGenerator&gt;</a>
+    reference page for more information.</li>
+  <li>Added the ability to specify wildcards for schema or tableName in a table
+      configuration.  This will allow generation of many tables with a simple
+      XML configuration.
+    See the <a href="configreference/table.html">&lt;table&gt;</a>
+    reference page for more information.</li>
+  <li>Added the ability to escape wildcard characters in schema or table names
+      if required by the driver.  See the <a href="configreference/table.html">&lt;table&gt;</a>
+      reference page for more information.</li>
+  <li>Added the ability to suppress JSE 5.0 type warning messages for non-parameterized
+      types if you are using the Legacy or Java2 generator sets in a JSE 5.0 environment.
+    See the <a href="configreference/abatorContext.html">&lt;abatorContext&gt;</a>
+    reference page for more information.
+  </li>
+  <li>Added the ability to specify an external properties file for passing
+    parameters into an Abator configuration file (like the iBATIS properties
+    file).  See the <a href="configreference/properties.html">&lt;properties&gt;</a>
+    reference page for more information.
+  </li>
+  <li>The Ant task now supports a "verbose" attribute.  See the
+    <a href="running.html">Running Abator</a> page for more information.
+  </li>
+  <li>The Ant task now supports a nested property set for passing values into
+      an Abator configuration file.  See the
+     <a href="running.html">Running Abator</a> page for more information.
+  </li>
+</ul>
+</body>
+</html>
\ No newline at end of file

Added: ibatis/java/ibator/trunk/core/ibator-core/doc/releasing.txt
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/doc/releasing.txt?rev=833772&view=auto
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-core/doc/releasing.txt (added)
+++ ibatis/java/ibator/trunk/core/ibator-core/doc/releasing.txt Sat Nov  7 22:59:00 2009
@@ -0,0 +1,41 @@
+Releasing Ibator:
+
+1. Increment the version number of Ibator in version.properties
+
+2. Build and test the base Ibator (make sure to use JDK 5.0)
+
+3. Build the new version of the Eclipse feature:
+  - Copy new ibator.jar and ibator-src.zip into the core plugin 
+  - Increment the version number of the feature
+  - Increment the version number of any plugin that has changed
+  - Build the doc
+  - Add the new version of the feature to site.xml in the IbatorUpdateSite
+    project
+  - Build the update site (just the new version, not build all)
+  - Delete the files artifacts.xml and content.xml generated by the
+    site builder (these files do not properly categorize the features.
+    See Eclipse bug 227675 for a possible solution in release 3.5)
+  - Do SVN Revert on any old plugin versions that were regenerated by the
+    site build process
+
+4. Run through the manual test scripts for the Eclipse feature
+
+5. Zip the contents of the update site (remove project metadata)
+  
+6. Commit everything
+
+7. Make an SVN label
+
+8. Put the new base Ibator zip file in /www/people.apache.org/builds/ibatis/alpha
+
+9. Put the new zipped eclipse site in /www/people.apache.org/builds/ibatis/alpha
+
+10. Update /www/ibatis.apache.org/doc/tools/ibator from SVN (this updates the documentation)
+
+11. Update /www/ibatis.apache.org/tools/ibator from SVN (this updates the Eclipse site)
+
+12. Update the DTD (if required)
+
+13. Update the iBATIS web site
+
+14. Send out the announcement to dev@ and user@

Added: ibatis/java/ibator/trunk/core/ibator-core/doc/todo.txt
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/doc/todo.txt?rev=833772&view=auto
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-core/doc/todo.txt (added)
+++ ibatis/java/ibator/trunk/core/ibator-core/doc/todo.txt Sat Nov  7 22:59:00 2009
@@ -0,0 +1,31 @@
+Core:
+
+  1.2.2
+
+    1. Add a way to override default types in the JavaTypeResolver
+    2. Document change to JavaTypeResolver interface in release notes
+    3. Document attributes
+
+
+  Future
+
+    1. Write page explaining how to use the GENERIC DAOs
+    
+    2. Change the base API to allow specifying a connection at
+       runtime, rather than requiring a connection in the 
+       XML config.
+
+    3. Relationships?
+
+    4. Java merger with ANTLR?
+
+
+Eclipse:
+
+  Future
+  
+    1. Write a launch configuration for the plugin to allow better
+       control of the class path.
+       
+    2. Get rid of the "Generate iBATIS Artifacts" popup menu - should
+       only run with a launch configuration or with Ant.

Propchange: ibatis/java/ibator/trunk/core/ibator-maven-plugin/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Nov  7 22:59:00 2009
@@ -0,0 +1 @@
+target

Added: ibatis/java/ibator/trunk/core/ibator-maven-plugin/pom.xml
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-maven-plugin/pom.xml?rev=833772&view=auto
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-maven-plugin/pom.xml (added)
+++ ibatis/java/ibator/trunk/core/ibator-maven-plugin/pom.xml Sat Nov  7 22:59:00 2009
@@ -0,0 +1,46 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.ibatis.ibator</groupId>
+  <artifactId>ibator-maven-plugin</artifactId>
+  <packaging>maven-plugin</packaging>
+  <version>1.2.2-SNAPSHOT</version>
+  <name>ibator-maven-plugin Maven Mojo</name>
+  <url>http://ibatis.apache.org/ibator.html</url>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>2.0.2</version>
+        <configuration>
+          <source>1.5</source>
+          <target>1.5</target>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-api</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.6</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+    	<groupId>org.apache.ibatis.ibator</groupId>
+    	<artifactId>ibator-core</artifactId>
+    	<version>1.2.2-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+    	<groupId>org.apache.maven</groupId>
+    	<artifactId>maven-project</artifactId>
+    	<version>2.1.0</version>
+    </dependency>
+  </dependencies>
+</project>

Added: ibatis/java/ibator/trunk/core/ibator-maven-plugin/src/main/java/org/apache/ibatis/ibator/maven/IbatorMojo.java
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-maven-plugin/src/main/java/org/apache/ibatis/ibator/maven/IbatorMojo.java?rev=833772&view=auto
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-maven-plugin/src/main/java/org/apache/ibatis/ibator/maven/IbatorMojo.java (added)
+++ ibatis/java/ibator/trunk/core/ibator-maven-plugin/src/main/java/org/apache/ibatis/ibator/maven/IbatorMojo.java Sat Nov  7 22:59:00 2009
@@ -0,0 +1,228 @@
+/*
+ * Copyright 2009 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.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ibatis.ibator.maven;
+
+import java.io.File;
+import java.io.IOException;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+
+import org.apache.ibatis.ibator.api.Ibator;
+import org.apache.ibatis.ibator.api.ShellCallback;
+import org.apache.ibatis.ibator.config.IbatorConfiguration;
+import org.apache.ibatis.ibator.config.xml.IbatorConfigurationParser;
+import org.apache.ibatis.ibator.exception.InvalidConfigurationException;
+import org.apache.ibatis.ibator.exception.XMLParserException;
+import org.apache.ibatis.ibator.internal.util.messages.Messages;
+import org.apache.maven.model.Resource;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.project.MavenProject;
+
+/**
+ * Goal which generates iBATIS artifacts.
+ * 
+ * @goal generate
+ * @phase generate-sources
+ */
+public class IbatorMojo extends AbstractMojo {
+    
+    /**
+     * @parameter expression="${project}"
+     * @required
+     * @readonly
+     * 
+     */
+    private MavenProject project;
+    
+    /**
+     * @parameter expression="${ibator.output.directory}" 
+     *             default-value="${project.build.directory}/generated-sources/ibator"
+     * @required
+     */
+    private File outputDirectory;
+    
+    /**
+     * Location of the configuration file.
+     * 
+     * @parameter expression="${ibator.configuration.file}"
+     *             default-value="${basedir}/src/main/resources/ibatorConfig.xml"
+     * @required
+     */
+    private File configFile;
+    
+    /**
+     * Specifies whether the mojo writes progress messages to the log
+     * 
+     * @parameter expression="${ibator.verbose}" default-value=false
+     */
+    private boolean verbose;
+
+    /**
+     * Specifies whether the mojo overwrites existing files.  Default is false.
+     * 
+     * @parameter expression="${ibator.overwrite}" default-value=false
+     */
+    private boolean overwrite;
+    
+    /**
+     * Location of a SQL script file to run before generating code.
+     * If null, then no script will be run.  If not null,
+     * then jdbc.driver, jdbc.url must be supplies also,
+     * and jdbc.user.id and jdbc.password may be supplied.
+     * 
+     * @parameter expression="${ibator.sql.script.file}"
+     */
+    private File sqlScript;
+    
+    /**
+     * JDBC Driver to use if a sql.script.file is specified
+     * 
+     * @parameter expression="${ibator.jdbc.driver}"
+     */
+    private String jdbcDriver;
+    
+    /**
+     * JDBC URL to use if a sql.script.file is specified
+     * 
+     * @parameter expression="${ibator.jdbc.url}"
+     */
+    private String jdbcURL;
+    
+    /**
+     * JDBC user ID to use if a sql.script.file is specified
+     * 
+     * @parameter expression="${ibator.jdbc.user.id}"
+     */
+    private String jdbcUserId;
+    
+    /**
+     * JDBC password to use if a sql.script.file is specified
+     * 
+     * @parameter expression="${ibator.jdbc.password}"
+     */
+    private String jdbcPassword;
+    
+    /**
+     * @parameter expression=${ibator.configuration.properties}
+     */
+    private Properties configurationProperties;
+    
+    public void execute() throws MojoExecutionException {
+        if (configFile == null) {
+            throw new MojoExecutionException(Messages.getString("RuntimeError.0")); //$NON-NLS-1$
+        }
+
+        List<String> warnings = new ArrayList<String>();
+
+        if (!configFile.exists()) {
+            throw new MojoExecutionException(Messages.getString(
+                    "RuntimeError.1", configFile.toString())); //$NON-NLS-1$
+        }
+        
+        runScriptIfNecessary();
+
+        Set<String> fullyqualifiedTables = new HashSet<String>();
+//        if (StringUtility.stringHasValue(fullyQualifiedTableNames)) {
+//            StringTokenizer st = new StringTokenizer(fullyQualifiedTableNames,
+//                    ","); //$NON-NLS-1$
+//            while (st.hasMoreTokens()) {
+//                String s = st.nextToken().trim();
+//                if (s.length() > 0) {
+//                    fullyqualifiedTables.add(s);
+//                }
+//            }
+//        }
+
+        Set<String> contexts = new HashSet<String>();
+//        if (StringUtility.stringHasValue(contextIds)) {
+//            StringTokenizer st = new StringTokenizer(contextIds, ","); //$NON-NLS-1$
+//            while (st.hasMoreTokens()) {
+//                String s = st.nextToken().trim();
+//                if (s.length() > 0) {
+//                    contexts.add(s);
+//                }
+//            }
+//        }
+
+        try {
+            IbatorConfigurationParser cp = new IbatorConfigurationParser(configurationProperties, warnings);
+            IbatorConfiguration config = cp
+                    .parseIbatorConfiguration(configFile);
+
+            ShellCallback callback = new MavenShellCallback(this, overwrite);
+
+            Ibator ibator = new Ibator(config, callback, warnings);
+
+            ibator.generate(new MavenProgressCallback(getLog(), verbose), contexts,
+                    fullyqualifiedTables);
+
+        } catch (XMLParserException e) {
+            for (String error : e.getErrors()) {
+                getLog().error(error);
+            }
+
+            throw new MojoExecutionException(e.getMessage());
+        } catch (SQLException e) {
+            throw new MojoExecutionException(e.getMessage());
+        } catch (IOException e) {
+            throw new MojoExecutionException(e.getMessage());
+        } catch (InvalidConfigurationException e) {
+            for (String error : e.getErrors()) {
+                getLog().error(error);
+            }
+
+            throw new MojoExecutionException(e.getMessage());
+        } catch (InterruptedException e) {
+            // ignore (will never happen with the DefaultShellCallback)
+            ;
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new MojoExecutionException(e.getMessage());
+        }
+
+        for (String error : warnings) {
+            getLog().warn(error);
+        }
+        
+        if (project != null && outputDirectory != null && outputDirectory.exists()) {
+            project.addCompileSourceRoot(outputDirectory.getAbsolutePath());
+            
+            Resource resource = new Resource();
+            resource.setDirectory(outputDirectory.getAbsolutePath());
+            resource.addInclude("**/*.xml");
+            project.addResource(resource);
+        }
+    }
+    
+    private void runScriptIfNecessary() throws MojoExecutionException {
+        if (sqlScript == null) {
+            return;
+        }
+        
+        SqlScriptRunner scriptRunner = new SqlScriptRunner(sqlScript, jdbcDriver, jdbcURL, jdbcUserId, jdbcPassword);
+        scriptRunner.setLog(getLog());
+        scriptRunner.executeScript();
+    }
+
+    public File getOutputDirectory() {
+        return outputDirectory;
+    }
+}

Added: ibatis/java/ibator/trunk/core/ibator-maven-plugin/src/main/java/org/apache/ibatis/ibator/maven/MavenProgressCallback.java
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-maven-plugin/src/main/java/org/apache/ibatis/ibator/maven/MavenProgressCallback.java?rev=833772&view=auto
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-maven-plugin/src/main/java/org/apache/ibatis/ibator/maven/MavenProgressCallback.java (added)
+++ ibatis/java/ibator/trunk/core/ibator-maven-plugin/src/main/java/org/apache/ibatis/ibator/maven/MavenProgressCallback.java Sat Nov  7 22:59:00 2009
@@ -0,0 +1,48 @@
+/*
+ *  Copyright 2009 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.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.ibatis.ibator.maven;
+
+import org.apache.ibatis.ibator.internal.NullProgressCallback;
+import org.apache.maven.plugin.logging.Log;
+
+/**
+ * This callback logs progress messages with the Maven logger
+ * 
+ * @author Jeff Butler
+ *
+ */
+public class MavenProgressCallback extends NullProgressCallback {
+
+    private Log log;
+    private boolean verbose;
+    
+    /**
+     * 
+     */
+    public MavenProgressCallback(Log log, boolean verbose) {
+        super();
+        this.log = log;
+        this.verbose = verbose;
+    }
+
+    @Override
+    public void startTask(String subTaskName) {
+        if (verbose) {
+            log.info(subTaskName);
+        }
+    }
+}

Added: ibatis/java/ibator/trunk/core/ibator-maven-plugin/src/main/java/org/apache/ibatis/ibator/maven/MavenShellCallback.java
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-maven-plugin/src/main/java/org/apache/ibatis/ibator/maven/MavenShellCallback.java?rev=833772&view=auto
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-maven-plugin/src/main/java/org/apache/ibatis/ibator/maven/MavenShellCallback.java (added)
+++ ibatis/java/ibator/trunk/core/ibator-maven-plugin/src/main/java/org/apache/ibatis/ibator/maven/MavenShellCallback.java Sat Nov  7 22:59:00 2009
@@ -0,0 +1,78 @@
+/*
+ *  Copyright 2009 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.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.ibatis.ibator.maven;
+
+import java.io.File;
+import java.util.StringTokenizer;
+
+import org.apache.ibatis.ibator.exception.ShellException;
+import org.apache.ibatis.ibator.internal.DefaultShellCallback;
+import org.apache.ibatis.ibator.internal.util.messages.Messages;
+
+/**
+ * @author Jeff Butler
+ */
+public class MavenShellCallback extends DefaultShellCallback {
+    private IbatorMojo ibatorMojo;
+
+    /**
+     * @param overwrite
+     */
+    public MavenShellCallback(IbatorMojo ibatorMojo, boolean overwrite) {
+        super(overwrite);
+        this.ibatorMojo = ibatorMojo;
+    }
+
+    @Override
+    public File getDirectory(String targetProject, String targetPackage)
+            throws ShellException {
+        // targetProject is the output directory from the ibator Mojo.
+        // it will be created if necessary
+        //
+        // targetPackage is interpreted as a sub directory, but in package
+        // format (with dots instead of slashes).  The sub directory will be created
+        // if it does not already exist
+        
+        File project = ibatorMojo.getOutputDirectory();
+        if (!project.exists()) {
+            project.mkdirs();
+        }
+        
+        if (!project.isDirectory()) {
+            throw new ShellException(Messages.getString("Warning.9", //$NON-NLS-1$
+                    project.getAbsolutePath()));
+        }
+        
+        StringBuilder sb = new StringBuilder();
+        StringTokenizer st = new StringTokenizer(targetPackage, "."); //$NON-NLS-1$
+        while (st.hasMoreTokens()) {
+            sb.append(st.nextToken());
+            sb.append(File.separatorChar);
+        }
+        
+        File directory = new File(project, sb.toString());
+        if (!directory.isDirectory()) {
+            boolean rc = directory.mkdirs();
+            if (!rc) {
+                throw new ShellException(Messages.getString("Warning.10", //$NON-NLS-1$
+                        directory.getAbsolutePath()));
+            }
+        }
+        
+        return directory;
+    }
+}

Added: ibatis/java/ibator/trunk/core/ibator-maven-plugin/src/main/java/org/apache/ibatis/ibator/maven/SqlScriptRunner.java
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-maven-plugin/src/main/java/org/apache/ibatis/ibator/maven/SqlScriptRunner.java?rev=833772&view=auto
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-maven-plugin/src/main/java/org/apache/ibatis/ibator/maven/SqlScriptRunner.java (added)
+++ ibatis/java/ibator/trunk/core/ibator-maven-plugin/src/main/java/org/apache/ibatis/ibator/maven/SqlScriptRunner.java Sat Nov  7 22:59:00 2009
@@ -0,0 +1,172 @@
+/*
+ * Copyright 2009 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.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ibatis.ibator.maven;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.sql.Statement;
+
+import org.apache.ibatis.ibator.internal.util.StringUtility;
+import org.apache.ibatis.ibator.internal.util.messages.Messages;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.logging.Log;
+
+/**
+ * This class is used to execute an SQL script before a code generation
+ * run if necessary.  Note that this class mainly exists to support the Ibator
+ * build.  It is intentionally not documented and not supported.
+ * 
+ * @author Jeff Butler
+ */
+public class SqlScriptRunner {
+    private String driver;
+    private String url;
+    private String userid;
+    private String password;
+    private File sourceFile;
+    private Log log;
+
+    public SqlScriptRunner(File sourceFile, String driver, String url,
+            String userId, String password) throws MojoExecutionException {
+        
+        if (!sourceFile.exists()) {
+            throw new MojoExecutionException("SQL script file does not exist");
+        }
+        
+        if (!StringUtility.stringHasValue(driver)) {
+            throw new MojoExecutionException("JDBC Driver is required");
+        }
+        
+        if (!StringUtility.stringHasValue(url)) {
+            throw new MojoExecutionException("JDBC URL is required");
+        }
+        
+        this.sourceFile = sourceFile;
+        this.driver = driver;
+        this.url = url;
+        this.userid = userId;
+        this.password = password;
+    }
+
+    public void executeScript() throws MojoExecutionException {
+
+        Connection connection = null;
+
+        try {
+            Class.forName(driver);
+            connection = DriverManager.getConnection(url, userid, password);
+
+            Statement statement = connection.createStatement();
+
+            BufferedReader br = new BufferedReader(new FileReader(sourceFile));
+
+            String sql;
+
+            while ((sql = readStatement(br)) != null) {
+                statement.execute(sql);
+            }
+
+            closeStatement(statement);
+            connection.commit();
+            br.close();
+        } catch (ClassNotFoundException e) {
+            throw new MojoExecutionException("Class not found: " + e.getMessage());
+        } catch (Exception e) {
+            throw new MojoExecutionException(e.getMessage());
+        } finally {
+            closeConnection(connection);
+        }
+    }
+
+    public String getDriver() {
+        return driver;
+    }
+
+    public void setDriver(String driver) {
+        this.driver = driver;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    private void closeConnection(Connection connection) {
+        if (connection != null) {
+            try {
+                connection.close();
+            } catch (SQLException e) {
+                // ignore
+                ;
+            }
+        }
+    }
+
+    private void closeStatement(Statement statement) {
+        if (statement != null) {
+            try {
+                statement.close();
+            } catch (SQLException e) {
+                // ignore
+                ;
+            }
+        }
+    }
+
+    private String readStatement(BufferedReader br) throws IOException {
+        StringBuffer sb = new StringBuffer();
+
+        String line;
+
+        while ((line = br.readLine()) != null) {
+            if (line.startsWith("--")) { //$NON-NLS-1$
+                continue;
+            }
+
+            if (!StringUtility.stringHasValue(line)) {
+                continue;
+            }
+
+            if (line.endsWith(";")) { //$NON-NLS-1$
+                sb.append(line.substring(0, line.length() - 1));
+                break;
+            } else {
+                sb.append(' ');
+                sb.append(line);
+            }
+        }
+
+        String s = sb.toString().trim();
+
+        if (s.length() > 0) {
+            log.debug((Messages.getString("Progress.13", s))); //$NON-NLS-1$
+        }
+
+        return s.length() > 0 ? s : null;
+    }
+
+    public void setLog(Log log) {
+        this.log = log;
+    }
+}

Added: ibatis/java/ibator/trunk/core/ibator-systests-ibatis2-java2/pom.xml
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-systests-ibatis2-java2/pom.xml?rev=833772&view=auto
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-systests-ibatis2-java2/pom.xml (added)
+++ ibatis/java/ibator/trunk/core/ibator-systests-ibatis2-java2/pom.xml Sat Nov  7 22:59:00 2009
@@ -0,0 +1,87 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.ibatis.ibator</groupId>
+  <artifactId>ibator-systests-ibatis2-java2</artifactId>
+  <version>1.2.2-SNAPSHOT</version>
+  <packaging>jar</packaging>
+  <name>ibator-systests-ibatis2-java2</name>
+  <url>http://ibatis.apache.org/ibator.html</url>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>2.0.2</version>
+        <configuration>
+          <source>1.4</source>
+          <target>1.4</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>2.4.3</version>
+        <configuration>
+          <forkMode>always</forkMode>
+        </configuration>
+      </plugin>
+      <plugin>
+      	<groupId>org.apache.ibatis.ibator</groupId>
+      	<artifactId>ibator-maven-plugin</artifactId>
+      	<version>1.2.2-SNAPSHOT</version>
+      	<executions>
+      	  <execution>
+      	    <id>Generate iBATIS Artifacts</id>
+      	    <goals>
+      	      <goal>generate</goal>
+      	    </goals>
+      	  </execution>
+      	</executions>
+        <configuration>
+      	  <sqlScript>src/main/resources/CreateDB.sql</sqlScript>
+      	  <jdbcDriver>org.hsqldb.jdbcDriver</jdbcDriver>
+       	  <jdbcURL>jdbc:hsqldb:mem:aname</jdbcURL>
+   	      <jdbcUserId>sa</jdbcUserId>
+   	      <overwrite>true</overwrite>
+   	    </configuration>
+      	<dependencies>
+          <dependency>
+    	    <groupId>org.hsqldb</groupId>
+    	    <artifactId>hsqldb</artifactId>
+    	    <version>1.8.0.10</version>
+          </dependency>
+      	</dependencies>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.6</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+    	<groupId>org.apache.ibatis</groupId>
+    	<artifactId>ibatis-sqlmap</artifactId>
+    	<version>2.3.4.726</version>
+    </dependency>
+    <dependency>
+    	<groupId>org.springframework</groupId>
+    	<artifactId>spring-orm</artifactId>
+    	<version>2.5.6</version>
+    </dependency>
+    <dependency>
+    	<groupId>org.springframework</groupId>
+    	<artifactId>spring-jdbc</artifactId>
+    	<version>2.5.6</version>
+    </dependency>
+    <dependency>
+    	<groupId>org.hsqldb</groupId>
+    	<artifactId>hsqldb</artifactId>
+    	<version>1.8.0.10</version>
+    	<scope>test</scope>
+    </dependency>
+  </dependencies>
+</project>

Added: ibatis/java/ibator/trunk/core/ibator-systests-ibatis2-java2/src/main/java/ibatortest/java2/execute/miscellaneous/BaseClass.java
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-systests-ibatis2-java2/src/main/java/ibatortest/java2/execute/miscellaneous/BaseClass.java?rev=833772&view=auto
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-systests-ibatis2-java2/src/main/java/ibatortest/java2/execute/miscellaneous/BaseClass.java (added)
+++ ibatis/java/ibator/trunk/core/ibator-systests-ibatis2-java2/src/main/java/ibatortest/java2/execute/miscellaneous/BaseClass.java Sat Nov  7 22:59:00 2009
@@ -0,0 +1,28 @@
+/*
+ *  Copyright 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.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package ibatortest.java2.execute.miscellaneous;
+
+/**
+ * @author Jeff Butler
+ */
+public class BaseClass {
+    /**
+     *
+     */
+    public BaseClass() {
+        super();
+    }
+}

Added: ibatis/java/ibator/trunk/core/ibator-systests-ibatis2-java2/src/main/java/ibatortest/java2/execute/miscellaneous/BaseInterface.java
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-systests-ibatis2-java2/src/main/java/ibatortest/java2/execute/miscellaneous/BaseInterface.java?rev=833772&view=auto
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-systests-ibatis2-java2/src/main/java/ibatortest/java2/execute/miscellaneous/BaseInterface.java (added)
+++ ibatis/java/ibator/trunk/core/ibator-systests-ibatis2-java2/src/main/java/ibatortest/java2/execute/miscellaneous/BaseInterface.java Sat Nov  7 22:59:00 2009
@@ -0,0 +1,23 @@
+/*
+ *  Copyright 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.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package ibatortest.java2.execute.miscellaneous;
+
+/**
+ * @author Jeff Butler
+ */
+public interface BaseInterface {
+
+}

Added: ibatis/java/ibator/trunk/core/ibator-systests-ibatis2-java2/src/main/java/ibatortest/java2/execute/miscellaneous/FirstName.java
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-systests-ibatis2-java2/src/main/java/ibatortest/java2/execute/miscellaneous/FirstName.java?rev=833772&view=auto
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-systests-ibatis2-java2/src/main/java/ibatortest/java2/execute/miscellaneous/FirstName.java (added)
+++ ibatis/java/ibator/trunk/core/ibator-systests-ibatis2-java2/src/main/java/ibatortest/java2/execute/miscellaneous/FirstName.java Sat Nov  7 22:59:00 2009
@@ -0,0 +1,54 @@
+/*
+ *  Copyright 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.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package ibatortest.java2.execute.miscellaneous;
+
+/**
+ * @author Jeff Butler
+ *
+ */
+public class FirstName {
+
+    private String value;
+
+    /**
+     *
+     */
+    public FirstName() {
+        super();
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    public boolean equals(Object arg0) {
+        if (arg0 == null) {
+            return false;
+        }
+
+        return value.equals(((FirstName)arg0).getValue());
+    }
+
+    public int hashCode() {
+        return value == null ? 0 : value.hashCode();
+    }
+
+}



Mime
View raw message