You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ibatis.apache.org by jg...@apache.org on 2007/02/24 00:21:01 UTC

svn commit: r511167 - in /ibatis/trunk/java/mapper/mapper2/tools/abator/core: build/ doc/ htmldoc/ htmldoc/configreference/ src/org/apache/ibatis/abator/api/ src/org/apache/ibatis/abator/config/ src/org/apache/ibatis/abator/internal/db/ src/org/apache/...

Author: jgbutler
Date: Fri Feb 23 15:20:56 2007
New Revision: 511167

URL: http://svn.apache.org/viewvc?view=rev&rev=511167
Log:
Abator: Documentation and other minor updates

Added:
    ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/PropertyRegistry.java
Modified:
    ibatis/trunk/java/mapper/mapper2/tools/abator/core/build/version.properties
    ibatis/trunk/java/mapper/mapper2/tools/abator/core/doc/ReleaseNotes.txt
    ibatis/trunk/java/mapper/mapper2/tools/abator/core/htmldoc/configreference/columnOverride.html
    ibatis/trunk/java/mapper/mapper2/tools/abator/core/htmldoc/configreference/table.html
    ibatis/trunk/java/mapper/mapper2/tools/abator/core/htmldoc/configreference/xmlconfig.html
    ibatis/trunk/java/mapper/mapper2/tools/abator/core/htmldoc/running.html
    ibatis/trunk/java/mapper/mapper2/tools/abator/core/htmldoc/whatsNew.html
    ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/api/DAOGenerator.java
    ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/api/JavaModelGenerator.java
    ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/api/JavaTypeResolver.java
    ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/api/SqlMapGenerator.java
    ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/AbatorContext.java
    ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/PropertyHolder.java
    ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/db/DatabaseIntrospector.java
    ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/db/IntrospectedTableImpl.java
    ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/java/dao/BaseDAOGenerator.java
    ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/java/model/JavaModelGeneratorJava2Impl.java
    ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/sqlmap/SqlMapGeneratorIterateImpl.java
    ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/types/JavaTypeResolverDefaultImpl.java

Modified: ibatis/trunk/java/mapper/mapper2/tools/abator/core/build/version.properties
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/tools/abator/core/build/version.properties?view=diff&rev=511167&r1=511166&r2=511167
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/tools/abator/core/build/version.properties (original)
+++ ibatis/trunk/java/mapper/mapper2/tools/abator/core/build/version.properties Fri Feb 23 15:20:56 2007
@@ -1,4 +1,4 @@
 #Abator build version info
-#Sat Feb 17 00:07:43 CST 2007
+#Fri Feb 23 17:15:14 CST 2007
 version=1.0.1
-buildNum=339
+buildNum=343

Modified: ibatis/trunk/java/mapper/mapper2/tools/abator/core/doc/ReleaseNotes.txt
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/tools/abator/core/doc/ReleaseNotes.txt?view=diff&rev=511167&r1=511166&r2=511167
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/tools/abator/core/doc/ReleaseNotes.txt (original)
+++ ibatis/trunk/java/mapper/mapper2/tools/abator/core/doc/ReleaseNotes.txt Fri Feb 23 15:20:56 2007
@@ -21,6 +21,8 @@
 7. Added the ability to specify that resultMaps should use column indexes
    rather than column name.  This is necessary in poorly designed tables
    where column names differ only in case.  This may also improve performance.
+8. Added the ability to work with delimited names in database tables or
+   columns.
 
 -------------------------------------------------------------------------------
 Version 1.0.0:

Modified: ibatis/trunk/java/mapper/mapper2/tools/abator/core/htmldoc/configreference/columnOverride.html
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/tools/abator/core/htmldoc/configreference/columnOverride.html?view=diff&rev=511167&r1=511166&r2=511167
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/tools/abator/core/htmldoc/configreference/columnOverride.html (original)
+++ ibatis/trunk/java/mapper/mapper2/tools/abator/core/htmldoc/configreference/columnOverride.html Fri Feb 23 15:20:56 2007
@@ -70,6 +70,21 @@
       in the generated SQL Map configuration file.
     </td>
   </tr>
+  <tr>
+    <td valign="top">delimitedColumnName</td>
+    <td>Specifies whether the column name should be delimited in the generated SQL.
+        Abator will automatically delimit the column name if the name contains a space,
+        so this override is only necessary when the column name is forces to a certain
+        case, or when the column name is a reserved word in the database.
+        <p>When "true", the <code>column</code> attribute for the override
+        must exactly match the case of the column name returned from the database.</p>
+        <p>The delimiter characters are specified on the
+        <a href="abatorContext.html">&lt;abatorContext&gt;</a> element.</p>
+        <p><i>The default value is false.  However, Abator will automatically
+        delimit column names that contain a space, so no override is necessary
+        in that case.</i></p>
+    </td>
+  </tr>
 </table>
 
 <h2>Child Elements</h2>

Modified: ibatis/trunk/java/mapper/mapper2/tools/abator/core/htmldoc/configreference/table.html
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/tools/abator/core/htmldoc/configreference/table.html?view=diff&rev=511167&r1=511166&r2=511167
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/tools/abator/core/htmldoc/configreference/table.html (original)
+++ ibatis/trunk/java/mapper/mapper2/tools/abator/core/htmldoc/configreference/table.html Fri Feb 23 15:20:56 2007
@@ -35,6 +35,36 @@
 <p>At least one &lt;table&gt; element must be specified as a required child element
 of the <a href="abatorContext.html">&lt;abatorContext&gt;</a> element.
 You can specify unlimited table elements.</p>
+
+<h2>Database Identifiers</h2>
+<p>Abator tries to deal with the case sensitivity of database identifiers automatically.
+In most cases, Abator is able to find tables regardless of what you
+specify for <code>catalog</code>, <code>schema</code>, and <code>tableName</code>
+attributes.  Abator's process follows these steps:</p>
+<ol>
+  <li>If either of the <code>catalog</code>, <code>schema</code>, or
+      <code>tableName</code> attributes contain a space, then Abator will
+      look for tables based on the exact case specified.  In this case, Abator
+      will automatically delimit the table identifiers in the generated SQL.</li>
+  <li>Else if the database reports that identifiers are stored in upper case,
+      Abator will automatically convert any table identifier to upper case.</li>
+  <li>Else if the database reports that identifiers are stored in lower case,
+      Abator will automatically convert any table identifier to lower case.</li>
+  <li>Else Abator will look for tables based on the exact case specified.</li>
+</ol>
+<p>In most cases, this process works perfectly.  However, there are cases where it will
+fail.  For example, suppose you create a table like this:</p>
+<pre>
+  create table "myTable" (
+     ...some columns
+  )
+</pre>
+
+<p>Because the table name is delimited, most databases will create the
+table with the exact case specified - even if the database normally stores
+identifiers in upper case.  In this instance, you should specify the attribute
+<code>delimitIdentifiers="true"</code> in the table configuration.</p>
+
 <h2>Required Attributes</h2>
 <table border="1" cellspacing="0" cellpadding="5">
   <tr>
@@ -177,6 +207,17 @@
         MY_TABLE, some drivers require that the underscore character be escaped).
         <p>The default is <i>false</i>.</p></td>
   </tr>
+  <tr>
+    <td valign="top">delimitIdentifiers</td>
+    <td>Signifies whether Abator should use the exact case specified when searching
+        for tables and then delimit the identifiers in the generated SQL.  See the
+        discussion above for more details.
+        <p>The delimiter characters are specified on the
+        <a href="abatorContext.html">&lt;abatorContext&gt;</a> element.</p>
+        <p>The default is <i>false</i> unless the <code>catalog</code>,
+        <code>schema</code>, or <code>tableName</code> attributes
+        contain a space, then <i>true</i>.</p></td>
+  </tr>
 </table>
 
 <h2>Child Elements</h2>
@@ -232,6 +273,14 @@
         actual table that the synonym points to, then specify the synonym name in
         this property.  You should also specify the <code>ignoreQualifiersAtRuntime</code>
         property in most cases with public synonyms.</td>
+  </tr>
+  <tr>
+    <td valign="top">useColumnIndexes</td>
+    <td>If true, then Abator will generate resultMaps that use column index rather than
+        column name in the result mappings.  This is useful when a table has column names
+        differentiated only by the case of the name (e.g. "first name" and "First Name").
+        There is a slight performance benefit with this support also.</p>
+        <p><i>The default value is false.</i></p></td>
   </tr>
 </table>
 

Modified: ibatis/trunk/java/mapper/mapper2/tools/abator/core/htmldoc/configreference/xmlconfig.html
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/tools/abator/core/htmldoc/configreference/xmlconfig.html?view=diff&rev=511167&r1=511166&r2=511167
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/tools/abator/core/htmldoc/configreference/xmlconfig.html (original)
+++ ibatis/trunk/java/mapper/mapper2/tools/abator/core/htmldoc/configreference/xmlconfig.html Fri Feb 23 15:20:56 2007
@@ -49,7 +49,7 @@
       &lt;property name="enableSubPackages" value="true" /&gt;
     &lt;/sqlMapGenerator&gt;
 
-    &lt;daoGenerator type="IBATIS" targetPackage="test.dao"  targetProject="\AbatorTestProject\src"&gt;
+    &lt;daoGenerator type="SPRING" targetPackage="test.dao"  targetProject="\AbatorTestProject\src"&gt;
       &lt;property name="enableSubPackages" value="true" /&gt;
     &lt;/daoGenerator&gt;
 
@@ -99,7 +99,7 @@
       to <code>false</code>,
       then the package would be <code>test.dao</code>.  The DAO generator should generate
       DAO classes
-      that conform to the iBATIS DAO framework.
+      that conform to the Spring framework.
   </li>
   <li>The file specifies only one table will be introspected, but many more could be specified.
       Important note about that table are as follows:

Modified: ibatis/trunk/java/mapper/mapper2/tools/abator/core/htmldoc/running.html
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/tools/abator/core/htmldoc/running.html?view=diff&rev=511167&r1=511166&r2=511167
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/tools/abator/core/htmldoc/running.html (original)
+++ ibatis/trunk/java/mapper/mapper2/tools/abator/core/htmldoc/running.html Fri Feb 23 15:20:56 2007
@@ -42,7 +42,8 @@
    should be overwritten.  If the flag is <code>false</code>, and an Java file already exists
    with the same name as a newly generated file, then Abator will write the
    newly generated Java file to the proper directory with a unique name
-   (e.g. MyClass.java.1, MyClass.java.2, etc.).</p>
+   (e.g. MyClass.java.1, MyClass.java.2, etc.).
+   <b>Important: Abator will always merge and overwrite XML files.</b></p>
 <p>You must still create an Abator XML configuration file.  If the file is
    named "abatorConfig.xml", then any of the following command lines will run
    Abator:</p>
@@ -55,7 +56,7 @@
 
 <h2>Running Abator from Ant</h2>
 <p>Abator includes a simple Ant task.  The task must be defined in your
-  build.xml file, and the task has two parameters.  Here is an example
+  build.xml file, and the task has three parameters.  Here is an example
   build.xml file:</p>
 <pre>
    &lt;project default="genfiles" basedir="."&gt;
@@ -78,12 +79,13 @@
   <li>The classpath on the &lt;taskdef&gt; is used to tell Ant where the implementing
      code is.  This is optional if you add Abator 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, "abator.genfiles" is
+   <li>The name of the task can be anything you desire, "abator" is
      simply an example</li>
    <li>The "overwrite" attribute is optional.  If "true", "yes", etc. then Abator
      will overwrite any existing Java files.  If "false", "no", etc. then
      Abator will not touch existing Java files - the newly generated Java file
-     will be saved with a unique filename instead.  The default is "false".</li>
+     will be saved with a unique filename instead.  The default is "false".
+     <b>Important: Abator will always merge and overwrite XML files.</b></li>
    <li>The "configfile" attribute is required - it must specify a valid Abator
      configuration XML file.</li>
    <li>The "verbose" attribute is optional.  If "true", "yes", etc then the task will

Modified: ibatis/trunk/java/mapper/mapper2/tools/abator/core/htmldoc/whatsNew.html
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/tools/abator/core/htmldoc/whatsNew.html?view=diff&rev=511167&r1=511166&r2=511167
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/tools/abator/core/htmldoc/whatsNew.html (original)
+++ ibatis/trunk/java/mapper/mapper2/tools/abator/core/htmldoc/whatsNew.html Fri Feb 23 15:20:56 2007
@@ -12,11 +12,12 @@
 <h2>Version 1.0.1</h2>
 <h3>Miscellaneous Changes</h3>
 <ul>
+  <li>Fixed a bug that caused the "trimStrings" property to fail</li>
   <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 in Oracle</li>
+        <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>
@@ -36,6 +37,17 @@
       as these characters have special meaning in iBATIS configuration files.</li>
   <li>Added a <code>clear</code> method to the generated example classes.  This allows reuse
       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>
 </ul>
 
 <h2>Version 1.0.0</h2>

Modified: ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/api/DAOGenerator.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/api/DAOGenerator.java?view=diff&rev=511167&r1=511166&r2=511167
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/api/DAOGenerator.java (original)
+++ ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/api/DAOGenerator.java Fri Feb 23 15:20:56 2007
@@ -16,7 +16,7 @@
 package org.apache.ibatis.abator.api;
 
 import java.util.List;
-import java.util.Map;
+import java.util.Properties;
 
 import org.apache.ibatis.abator.config.AbatorContext;
 
@@ -36,7 +36,7 @@
      * @param properties
      *            All properties from the configuration
      */
-    void addConfigurationProperties(Map properties);
+    void addConfigurationProperties(Properties properties);
     
     /**
      * Sets the instance of the AbatorConfiguration object associated with 

Modified: ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/api/JavaModelGenerator.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/api/JavaModelGenerator.java?view=diff&rev=511167&r1=511166&r2=511167
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/api/JavaModelGenerator.java (original)
+++ ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/api/JavaModelGenerator.java Fri Feb 23 15:20:56 2007
@@ -16,7 +16,7 @@
 package org.apache.ibatis.abator.api;
 
 import java.util.List;
-import java.util.Map;
+import java.util.Properties;
 
 import org.apache.ibatis.abator.api.dom.java.FullyQualifiedJavaType;
 import org.apache.ibatis.abator.config.AbatorContext;
@@ -46,7 +46,7 @@
      * @param properties
      *            All properties from the configuration
      */
-    void addConfigurationProperties(Map properties);
+    void addConfigurationProperties(Properties properties);
     
     /**
      * Sets the instance of the AbatorConfiguration object associated with 

Modified: ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/api/JavaTypeResolver.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/api/JavaTypeResolver.java?view=diff&rev=511167&r1=511166&r2=511167
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/api/JavaTypeResolver.java (original)
+++ ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/api/JavaTypeResolver.java Fri Feb 23 15:20:56 2007
@@ -16,7 +16,7 @@
 package org.apache.ibatis.abator.api;
 
 import java.util.List;
-import java.util.Map;
+import java.util.Properties;
 
 import org.apache.ibatis.abator.config.AbatorContext;
 import org.apache.ibatis.abator.exception.UnsupportedDataTypeException;
@@ -40,7 +40,7 @@
      * @param properties
      *            All properties from the configuration
      */
-    void addConfigurationProperties(Map properties);
+    void addConfigurationProperties(Properties properties);
     
     /**
      * Sets the instance of the AbatorConfiguration object associated with 

Modified: ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/api/SqlMapGenerator.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/api/SqlMapGenerator.java?view=diff&rev=511167&r1=511166&r2=511167
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/api/SqlMapGenerator.java (original)
+++ ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/api/SqlMapGenerator.java Fri Feb 23 15:20:56 2007
@@ -16,7 +16,7 @@
 package org.apache.ibatis.abator.api;
 
 import java.util.List;
-import java.util.Map;
+import java.util.Properties;
 
 import org.apache.ibatis.abator.config.AbatorContext;
 
@@ -49,7 +49,7 @@
      * @param properties
      *            All properties from the configuration
      */
-    void addConfigurationProperties(Map properties);
+    void addConfigurationProperties(Properties properties);
     
     /**
      * Sets the instance of the AbatorConfiguration object associated with 

Modified: ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/AbatorContext.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/AbatorContext.java?view=diff&rev=511167&r1=511166&r2=511167
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/AbatorContext.java (original)
+++ ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/AbatorContext.java Fri Feb 23 15:20:56 2007
@@ -218,7 +218,7 @@
 						tableName));
 		}
         
-        if ("true".equalsIgnoreCase((String) tc.getProperties().get("useColumnIndexes"))) {  //$NON-NLS-1$  //$NON-NLS-2$
+        if ("true".equalsIgnoreCase(tc.getProperty(PropertyRegistry.TABLE_USE_COLUMN_INDEXES))) {  //$NON-NLS-1$
             // when using column indexes, either both or neither query ids should be set
             if (tc.isSelectByExampleStatementEnabled() && tc.isSelectByPrimaryKeyStatementEnabled()) {
                 boolean queryId1Set = StringUtility.stringHasValue(tc.getSelectByExampleQueryId());
@@ -442,11 +442,11 @@
     public void addProperty(String name, String value) {
         super.addProperty(name, value);
         
-        if ("suppressTypeWarnings".equals(name)) { //$NON-NLS-1$
+        if (PropertyRegistry.CONTEXT_SUPPRESS_TYPE_WARNINGS.equals(name)) {
             suppressTypeWarnings = "true".equalsIgnoreCase(value); //$NON-NLS-1$
-        } else if ("beginningDelimiter".equals(name)) { //$NON-NLS-1$
+        } else if (PropertyRegistry.CONTEXT_BEGINNING_DELIMITER.equals(name)) {
             beginningDelimiter = value;
-        } else if ("endingDelimiter".equals(name)) { //$NON-NLS-1$
+        } else if (PropertyRegistry.CONTEXT_ENDING_DELIMITER.equals(name)) {
             endingDelimiter = value;
         }
     }

Modified: ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/PropertyHolder.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/PropertyHolder.java?view=diff&rev=511167&r1=511166&r2=511167
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/PropertyHolder.java (original)
+++ ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/PropertyHolder.java Fri Feb 23 15:20:56 2007
@@ -15,9 +15,8 @@
  */
 package org.apache.ibatis.abator.config;
 
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
+import java.util.Enumeration;
+import java.util.Properties;
 
 import org.apache.ibatis.abator.api.dom.xml.Attribute;
 import org.apache.ibatis.abator.api.dom.xml.XmlElement;
@@ -26,31 +25,36 @@
  * @author Jeff Butler
  */
 public abstract class PropertyHolder {
-	private Map properties;
+	private Properties properties;
 
 	/**
 	 *  
 	 */
 	public PropertyHolder() {
 		super();
-		properties = new HashMap();
+		properties = new Properties();
 	}
 
 	public void addProperty(String name, String value) {
-		properties.put(name, value);
+		properties.setProperty(name, value);
 	}
 
-	public Map getProperties() {
+    public String getProperty(String name) {
+        return properties.getProperty(name);
+    }
+    
+	public Properties getProperties() {
 		return properties;
 	}
     
     protected void addPropertyXmlElements(XmlElement xmlElement) {
-        Iterator iter = properties.entrySet().iterator();
-        while (iter.hasNext()) {
-            Map.Entry entry = (Map.Entry) iter.next();
+        Enumeration enumeration = properties.propertyNames();
+        while (enumeration.hasMoreElements()) {
+            String propertyName = (String) enumeration.nextElement();
+            
             XmlElement propertyElement = new XmlElement("property"); //$NON-NLS-1$
-            propertyElement.addAttribute(new Attribute("name", (String) entry.getKey())); //$NON-NLS-1$
-            propertyElement.addAttribute(new Attribute("value", (String) entry.getValue())); //$NON-NLS-1$
+            propertyElement.addAttribute(new Attribute("name", propertyName)); //$NON-NLS-1$
+            propertyElement.addAttribute(new Attribute("value", properties.getProperty(propertyName))); //$NON-NLS-1$
             xmlElement.addElement(propertyElement);
         }
     }

Added: ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/PropertyRegistry.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/PropertyRegistry.java?view=auto&rev=511167
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/PropertyRegistry.java (added)
+++ ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/PropertyRegistry.java Fri Feb 23 15:20:56 2007
@@ -0,0 +1,48 @@
+/*
+ *  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 org.apache.ibatis.abator.config;
+
+/**
+ * This class holds constants for all properties recognized by
+ * the different configuration elements.  This helps document
+ * and maintain the different properties, and helps to avoid spelling
+ * errors.
+ * 
+ * @author Jeff Butler
+ *
+ */
+public class PropertyRegistry {
+    public static final String ANY_ENABLE_SUB_PACKAGES = "enableSubPackages"; //$NON-NLS-1$
+    
+    public static final String TABLE_USE_COLUMN_INDEXES = "useColumnIndexes"; //$NON-NLS-1$
+    public static final String TABLE_USE_ACTUAL_COLUMN_NAMES = "useActualColumnNames"; //$NON-NLS-1$
+    public static final String TABLE_IGNORE_QUALIFIERS_AT_RUNTIME = "ignoreQualifiersAtRuntime"; //$NON-NLS-1$
+    public static final String TABLE_RUNTIME_TABLE_NAME = "runtimeTableName"; //$NON-NLS-1$
+
+    public static final String CONTEXT_SUPPRESS_TYPE_WARNINGS = "suppressTypeWarnings"; //$NON-NLS-1$
+    public static final String CONTEXT_BEGINNING_DELIMITER = "beginningDelimiter"; //$NON-NLS-1$
+    public static final String CONTEXT_ENDING_DELIMITER = "endingDelimiter"; //$NON-NLS-1$
+
+    public static final String DAO_EXAMPLE_METHOD_VISIBILITY = "exampleMethodVisibility"; //$NON-NLS-1$
+    public static final String DAO_METHOD_NAME_CALCULATOR = "methodNameCalculator"; //$NON-NLS-1$
+    public static final String DAO_ROOT_INTERFACE = "rootInterface"; //$NON-NLS-1$
+
+    public static final String TYPE_RESOLVER_FORCE_BIG_DECIMALS = "forceBigDecimals"; //$NON-NLS-1$
+
+    public static final String MODEL_GENERATOR_ROOT_CLASS = "rootClass"; //$NON-NLS-1$
+    public static final String MODEL_GENERATOR_TRIM_STRINGS = "trimStrings"; //$NON-NLS-1$
+}

Modified: ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/db/DatabaseIntrospector.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/db/DatabaseIntrospector.java?view=diff&rev=511167&r1=511166&r2=511167
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/db/DatabaseIntrospector.java (original)
+++ ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/db/DatabaseIntrospector.java Fri Feb 23 15:20:56 2007
@@ -19,7 +19,6 @@
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -33,6 +32,7 @@
 import org.apache.ibatis.abator.config.ColumnOverride;
 import org.apache.ibatis.abator.config.GeneratedKey;
 import org.apache.ibatis.abator.config.IgnoredColumn;
+import org.apache.ibatis.abator.config.PropertyRegistry;
 import org.apache.ibatis.abator.config.TableConfiguration;
 import org.apache.ibatis.abator.exception.UnsupportedDataTypeException;
 import org.apache.ibatis.abator.internal.util.JavaBeansUtil;
@@ -59,225 +59,6 @@
         this.warnings = warnings;
     }
 
-    public Collection introspectTables_old(TableConfiguration tc) throws SQLException {
-
-        Map introspectedTables = new HashMap();
-        
-        boolean delimitIdentifiers = tc.isDelimitIdentifiers()
-            || StringUtility.stringContainsSpace(tc.getCatalog())
-            || StringUtility.stringContainsSpace(tc.getSchema())
-            || StringUtility.stringContainsSpace(tc.getTableName());
-
-        String localCatalog;
-        String localSchema;
-        String localTableName;
-        
-        if (delimitIdentifiers) {
-            localCatalog = tc.getCatalog();
-            localSchema = tc.getSchema();
-            localTableName = tc.getTableName();
-        } else if (databaseMetaData.storesLowerCaseIdentifiers()) {
-            localCatalog = tc.getCatalog() == null ? null : tc.getCatalog()
-                    .toLowerCase();
-            localSchema = tc.getSchema() == null ? null : tc.getSchema()
-                    .toLowerCase();
-            localTableName = tc.getTableName() == null ? null : tc
-                    .getTableName().toLowerCase();
-        } else if (databaseMetaData.storesUpperCaseIdentifiers()) {
-            localCatalog = tc.getCatalog() == null ? null : tc.getCatalog()
-                    .toUpperCase();
-            localSchema = tc.getSchema() == null ? null : tc.getSchema()
-                    .toUpperCase();
-            localTableName = tc.getTableName() == null ? null : tc
-                    .getTableName().toUpperCase();
-        } else {
-            localCatalog = tc.getCatalog();
-            localSchema = tc.getSchema();
-            localTableName = tc.getTableName();
-        }
-
-        if (tc.isWildcardEscapingEnabled()) {
-            String escapeString = databaseMetaData.getSearchStringEscape();
-            
-            StringBuffer sb = new StringBuffer();
-            StringTokenizer st;
-            if (localSchema != null) {
-                st = new StringTokenizer(localSchema, "_%", true); //$NON-NLS-1$
-                while (st.hasMoreTokens()) {
-                    String token = st.nextToken();
-                    if (token.equals("_") //$NON-NLS-1$
-                            || token.equals("%")) { //$NON-NLS-1$
-                        sb.append(escapeString);
-                    }
-                    sb.append(token);
-                }
-                localSchema = sb.toString();
-            }
-            
-            sb.setLength(0);
-            st = new StringTokenizer(localTableName, "_%", true); //$NON-NLS-1$
-            while (st.hasMoreTokens()) {
-                String token = st.nextToken();
-                if (token.equals("_") //$NON-NLS-1$
-                        || token.equals("%")) { //$NON-NLS-1$
-                    sb.append(escapeString);
-                }
-                sb.append(token);
-            }
-            localTableName = sb.toString();
-        }
-
-        ResultSet rs = databaseMetaData.getColumns(localCatalog, localSchema,
-                localTableName, null);
-
-        int returnedColumns = 0;
-        while (rs.next()) {
-            returnedColumns++;
-            
-            ColumnDefinition cd = new ColumnDefinition(tc.getAlias(), abatorContext);
-
-            cd.setJdbcType(rs.getInt("DATA_TYPE")); //$NON-NLS-1$
-            cd.setLength(rs.getInt("COLUMN_SIZE")); //$NON-NLS-1$
-            cd.setActualColumnName(rs.getString("COLUMN_NAME")); //$NON-NLS-1$
-            cd.setNullable(rs.getInt("NULLABLE") == DatabaseMetaData.columnNullable); //$NON-NLS-1$
-            cd.setScale(rs.getInt("DECIMAL_DIGITS")); //$NON-NLS-1$
-            cd.setTypeName(rs.getString("TYPE_NAME")); //$NON-NLS-1$
-            
-            String tableName = rs.getString("TABLE_NAME"); //$NON-NLS-1$
-            String catalog = rs.getString("TABLE_CAT"); //$NON-NLS-1$
-            String schema = rs.getString("TABLE_SCHEM"); //$NON-NLS-1$
-            
-            // we only use the returned catalog and schema if something was actually
-            // specified on the table configuration.  If something was returned
-            // from the DB for these fields, but nothing was specified on the table
-            // configuration, then some sort of DB default is being returned
-            // and we don't want that in our SQL
-            FullyQualifiedTable table = new FullyQualifiedTable(
-                    StringUtility.stringHasValue(tc.getCatalog()) ? catalog : null,
-                    StringUtility.stringHasValue(tc.getSchema()) ? schema : null,
-                    tableName,
-                    tc.getDomainObjectName(),
-                    tc.getAlias(),
-                    "true".equalsIgnoreCase((String) tc.getProperties().get("ignoreQualifiersAtRuntime")), //$NON-NLS-1$ //$NON-NLS-2$
-                    (String) tc.getProperties().get("runtimeTableName"), //$NON-NLS-1$
-                    delimitIdentifiers,
-                    abatorContext);
-            
-            ColumnOverride columnOverride = tc.getColumnOverride(cd
-                    .getActualColumnName());
-
-            if (columnOverride == null
-                    || !StringUtility.stringHasValue(columnOverride
-                            .getJavaProperty())) {
-                if ("true".equalsIgnoreCase((String) tc.getProperties().get("useActualColumnNames"))) { //$NON-NLS-1$ //$NON-NLS-2$
-                    cd.setJavaProperty(JavaBeansUtil.getValidPropertyName(cd
-                            .getActualColumnName()));
-                } else {
-                    cd.setJavaProperty(JavaBeansUtil.getCamelCaseString(cd
-                            .getActualColumnName(), false));
-                }
-            } else {
-                cd.setJavaProperty(columnOverride.getJavaProperty());
-            }
-
-            try {
-                javaTypeResolver.initializeResolvedJavaType(cd);
-            } catch (UnsupportedDataTypeException e) {
-                // if the type is not supported, then we'll report a warning and
-                // ignore the column
-                warnings.add(Messages.getString("Warning.14", //$NON-NLS-1$
-                        table.toString(),
-                        cd.getActualColumnName()));
-                continue;
-            }
-
-            if (columnOverride != null
-                    && StringUtility.stringHasValue(columnOverride
-                            .getJavaType())) {
-                cd.getResolvedJavaType()
-                        .setFullyQualifiedJavaType(
-                                new FullyQualifiedJavaType(columnOverride
-                                        .getJavaType()));
-            }
-
-            if (columnOverride != null
-                    && StringUtility.stringHasValue(columnOverride
-                            .getJdbcType())) {
-                cd.getResolvedJavaType().setJdbcTypeName(
-                        columnOverride.getJdbcType());
-            }
-
-            if (columnOverride != null
-                    && StringUtility.stringHasValue(columnOverride
-                            .getTypeHandler())) {
-                cd.setTypeHandler(columnOverride.getTypeHandler());
-            }
-
-            if (tc.getGeneratedKey() != null
-                    && tc.getGeneratedKey().isIdentity()
-                    && cd.getActualColumnName().equalsIgnoreCase(
-                            tc.getGeneratedKey().getColumn())) {
-                cd.setIdentity(true);
-            } else {
-                cd.setIdentity(false);
-            }
-
-            if (!tc.isColumnIgnored(cd.getActualColumnName())) {
-                IntrospectedTableImpl introspectedTable =
-                    (IntrospectedTableImpl) introspectedTables.get(table);
-                if (introspectedTable == null) {
-                    introspectedTable = new IntrospectedTableImpl(tc, new ColumnDefinitions(), table);
-                    introspectedTables.put(table, introspectedTable);
-                }
-                
-                introspectedTable.getColumnDefinitions().addColumn(cd);
-            }
-        }
-
-        rs.close();
-        
-        if (returnedColumns == 0) {
-            warnings.add(Messages.getString("Warning.19", tc.getCatalog(), //$NON-NLS-1$
-                    tc.getSchema(), tc.getTableName()));
-        }
-        
-        Iterator iter = introspectedTables.values().iterator();
-        while (iter.hasNext()) {
-            IntrospectedTableImpl it = (IntrospectedTableImpl) iter.next();
-            calculatePrimaryKey(it);
-        }
-        
-        // now introspectedTables has all the columns from all the 
-        // tables in the configuration.  Do some validation...
-
-        iter = introspectedTables.entrySet().iterator();
-        while (iter.hasNext()) {
-            Map.Entry entry = (Map.Entry) iter.next();
-            
-            IntrospectedTableImpl introspectedTable = 
-                (IntrospectedTableImpl) entry.getValue();
-            
-            ColumnDefinitions cds = introspectedTable.getColumnDefinitions();
-            
-            if (!cds.hasAnyColumns()) {
-                // add warning that the table has no columns, remove from the list
-                warnings.add(Messages.getString("Warning.1", introspectedTable.getTable().toString())); //$NON-NLS-1$
-                iter.remove();
-            } else if (!cds.hasPrimaryKeyColumns()
-                    && !cds.hasBaseColumns()) {
-                // add warning that the table has only BLOB columns, remove from the list
-                warnings.add(Messages.getString("Warning.18", introspectedTable.getTable().toString())); //$NON-NLS-1$
-                iter.remove();
-            } else {
-                // now make sure that all columns called out in the configuration
-                // actually exist
-                reportIntrospectionWarnings(cds, tc, introspectedTable.getTable());
-            }
-        }
-
-        return introspectedTables.values();
-    }
-    
     private void calculatePrimaryKey(IntrospectedTableImpl introspectedTable) {
         ResultSet rs = null;
 
@@ -440,7 +221,7 @@
             while (tableColumns.hasNext()) {
                 ColumnDefinition cd = (ColumnDefinition) tableColumns.next();
                 
-                if ("true".equalsIgnoreCase((String) tc.getProperties().get("useActualColumnNames"))) { //$NON-NLS-1$ //$NON-NLS-2$
+                if ("true".equalsIgnoreCase(tc.getProperty(PropertyRegistry.TABLE_USE_ACTUAL_COLUMN_NAMES))) { //$NON-NLS-1$
                     cd.setJavaProperty(JavaBeansUtil.getValidPropertyName(cd
                             .getActualColumnName()));
                 } else {
@@ -659,8 +440,8 @@
                     atn.getTableName(),
                     tc.getDomainObjectName(),
                     tc.getAlias(),
-                    "true".equalsIgnoreCase((String) tc.getProperties().get("ignoreQualifiersAtRuntime")), //$NON-NLS-1$ //$NON-NLS-2$
-                    (String) tc.getProperties().get("runtimeTableName"), //$NON-NLS-1$
+                    "true".equalsIgnoreCase(tc.getProperty(PropertyRegistry.TABLE_IGNORE_QUALIFIERS_AT_RUNTIME)), //$NON-NLS-1$
+                    tc.getProperty(PropertyRegistry.TABLE_RUNTIME_TABLE_NAME),
                     delimitIdentifiers,
                     abatorContext);
 

Modified: ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/db/IntrospectedTableImpl.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/db/IntrospectedTableImpl.java?view=diff&rev=511167&r1=511166&r2=511167
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/db/IntrospectedTableImpl.java (original)
+++ ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/db/IntrospectedTableImpl.java Fri Feb 23 15:20:56 2007
@@ -150,6 +150,6 @@
     }
 
     public String getTableConfigurationProperty(String property) {
-        return (String) tableConfiguration.getProperties().get(property);
+        return tableConfiguration.getProperty(property);
     }
 }

Modified: ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/java/dao/BaseDAOGenerator.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/java/dao/BaseDAOGenerator.java?view=diff&rev=511167&r1=511166&r2=511167
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/java/dao/BaseDAOGenerator.java (original)
+++ ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/java/dao/BaseDAOGenerator.java Fri Feb 23 15:20:56 2007
@@ -20,6 +20,7 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.Properties;
 
 import org.apache.ibatis.abator.api.DAOGenerator;
 import org.apache.ibatis.abator.api.DAOMethodNameCalculator;
@@ -39,6 +40,7 @@
 import org.apache.ibatis.abator.api.dom.java.PrimitiveTypeWrapper;
 import org.apache.ibatis.abator.api.dom.java.TopLevelClass;
 import org.apache.ibatis.abator.config.AbatorContext;
+import org.apache.ibatis.abator.config.PropertyRegistry;
 import org.apache.ibatis.abator.internal.AbatorObjectFactory;
 import org.apache.ibatis.abator.internal.DefaultDAOMethodNameCalculator;
 import org.apache.ibatis.abator.internal.ExtendedDAOMethodNameCalculator;
@@ -91,7 +93,7 @@
     protected AbatorContext abatorContext;
     protected AbstractDAOTemplate daoTemplate;
 
-    protected Map properties;
+    protected Properties properties;
 
     protected List warnings;
 
@@ -120,15 +122,14 @@
         this.daoTemplate = daoTemplate;
         this.useJava5Features = useJava5Features;
         tableValueMaps = new HashMap();
-        properties = new HashMap();
+        properties = new Properties();
     }
 
-    public void addConfigurationProperties(Map properties) {
+    public void addConfigurationProperties(Properties properties) {
         this.properties.putAll(properties);
         
-        if (properties.containsKey("exampleMethodVisibility")) { //$NON-NLS-1$
-            String value = (String) properties.get("exampleMethodVisibility"); //$NON-NLS-1$
-            
+        String value = properties.getProperty(PropertyRegistry.DAO_EXAMPLE_METHOD_VISIBILITY);
+        if (StringUtility.stringHasValue(value)) {
             if ("public".equalsIgnoreCase(value)) { //$NON-NLS-1$
                 exampleMethodVisibility = JavaVisibility.PUBLIC;
             } else if ("private".equalsIgnoreCase(value)) { //$NON-NLS-1$
@@ -142,9 +143,8 @@
             }
         }
         
-        if (properties.containsKey("methodNameCalculator")) { //$NON-NLS-1$
-            String value = (String) properties.get("methodNameCalculator"); //$NON-NLS-1$
-            
+        value = properties.getProperty(PropertyRegistry.DAO_METHOD_NAME_CALCULATOR);
+        if (StringUtility.stringHasValue(value)) {
             if ("extended".equalsIgnoreCase(value)) { //$NON-NLS-1$
                 methodNameCalculator = new ExtendedDAOMethodNameCalculator();
             } else if (!"default".equalsIgnoreCase(value) //$NON-NLS-1$
@@ -392,9 +392,9 @@
         Interface answer = new Interface(getDAOInterfaceType(table));
         answer.setVisibility(JavaVisibility.PUBLIC);
 
-        if (properties.containsKey("rootInterface")) { //$NON-NLS-1$
-            FullyQualifiedJavaType fqjt = new FullyQualifiedJavaType(
-                    (String) properties.get("rootInterface")); //$NON-NLS-1$
+        String rootInterface = properties.getProperty(PropertyRegistry.DAO_ROOT_INTERFACE);
+        if (StringUtility.stringHasValue(rootInterface)) {
+            FullyQualifiedJavaType fqjt = new FullyQualifiedJavaType(rootInterface);
             answer.addSuperInterface(fqjt);
             answer.addImportedType(fqjt);
         }
@@ -1114,7 +1114,7 @@
         s = (String) map.get(key);
         if (s == null) {
             StringBuffer sb = new StringBuffer(targetPackage);
-            if ("true".equalsIgnoreCase((String)properties.get("enableSubPackages"))) { //$NON-NLS-1$  //$NON-NLS-2$
+            if ("true".equalsIgnoreCase(properties.getProperty(PropertyRegistry.ANY_ENABLE_SUB_PACKAGES))) { //$NON-NLS-1$
                 sb.append(table.getSubPackage());
             }
 

Modified: ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/java/model/JavaModelGeneratorJava2Impl.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/java/model/JavaModelGeneratorJava2Impl.java?view=diff&rev=511167&r1=511166&r2=511167
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/java/model/JavaModelGeneratorJava2Impl.java (original)
+++ ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/java/model/JavaModelGeneratorJava2Impl.java Fri Feb 23 15:20:56 2007
@@ -20,6 +20,7 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.Properties;
 
 import org.apache.ibatis.abator.api.FullyQualifiedTable;
 import org.apache.ibatis.abator.api.GeneratedJavaFile;
@@ -35,6 +36,7 @@
 import org.apache.ibatis.abator.api.dom.java.Parameter;
 import org.apache.ibatis.abator.api.dom.java.TopLevelClass;
 import org.apache.ibatis.abator.config.AbatorContext;
+import org.apache.ibatis.abator.config.PropertyRegistry;
 import org.apache.ibatis.abator.internal.db.ColumnDefinition;
 import org.apache.ibatis.abator.internal.util.JavaBeansUtil;
 import org.apache.ibatis.abator.internal.util.StringUtility;
@@ -75,7 +77,7 @@
     /**
      * The properties from the JavaModelGenerator congiguration element
      */
-    protected Map properties;
+    protected Properties properties;
 
     /**
      * The target package from the JavaModelGenerator congiguration element
@@ -92,10 +94,10 @@
     public JavaModelGeneratorJava2Impl() {
         super();
         tableValueMaps = new HashMap();
-        properties = new HashMap();
+        properties = new Properties();
     }
 
-    public void addConfigurationProperties(Map properties) {
+    public void addConfigurationProperties(Properties properties) {
         this.properties.putAll(properties);
     }
 
@@ -135,8 +137,8 @@
     protected void generateClassParts(FullyQualifiedTable table,
             Iterator columnDefinitions, TopLevelClass topLevelClass) {
 
-        boolean trimStrings = "true".equalsIgnoreCase((String) properties //$NON-NLS-1$
-                .get("trimStrings")); //$NON-NLS-1$
+        boolean trimStrings = "true".equalsIgnoreCase(properties //$NON-NLS-1$
+                .getProperty(PropertyRegistry.MODEL_GENERATOR_TRIM_STRINGS));
 
         StringBuffer sb = new StringBuffer();
         Field field;
@@ -215,7 +217,7 @@
         s = (String) map.get(key);
         if (s == null) {
             StringBuffer sb = new StringBuffer(targetPackage);
-            if ("true".equalsIgnoreCase((String)properties.get("enableSubPackages"))) { //$NON-NLS-1$  //$NON-NLS-2$
+            if ("true".equalsIgnoreCase(properties.getProperty(PropertyRegistry.ANY_ENABLE_SUB_PACKAGES))) { //$NON-NLS-1$
                 sb.append(table.getSubPackage());
             }
             
@@ -237,7 +239,7 @@
         TopLevelClass answer = new TopLevelClass(type);
         answer.setVisibility(JavaVisibility.PUBLIC);
 
-        String rootClass = (String) properties.get("rootClass"); //$NON-NLS-1$
+        String rootClass = properties.getProperty(PropertyRegistry.MODEL_GENERATOR_ROOT_CLASS);
         if (rootClass != null) {
             answer.setSuperClass(new FullyQualifiedJavaType(rootClass));
             answer.addImportedType(answer.getSuperClass());
@@ -262,7 +264,7 @@
         if (introspectedTable.getRules().generatePrimaryKeyClass()) {
             answer.setSuperClass(getPrimaryKeyType(table));
         } else {
-            String rootClass = (String) properties.get("rootClass"); //$NON-NLS-1$
+            String rootClass = properties.getProperty(PropertyRegistry.MODEL_GENERATOR_ROOT_CLASS);
             if (rootClass != null) {
                 answer.setSuperClass(new FullyQualifiedJavaType(rootClass));
                 answer.addImportedType(answer.getSuperClass());

Modified: ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/sqlmap/SqlMapGeneratorIterateImpl.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/sqlmap/SqlMapGeneratorIterateImpl.java?view=diff&rev=511167&r1=511166&r2=511167
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/sqlmap/SqlMapGeneratorIterateImpl.java (original)
+++ ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/sqlmap/SqlMapGeneratorIterateImpl.java Fri Feb 23 15:20:56 2007
@@ -20,6 +20,7 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.Properties;
 
 import org.apache.ibatis.abator.api.FullyQualifiedTable;
 import org.apache.ibatis.abator.api.GeneratedXmlFile;
@@ -35,6 +36,7 @@
 import org.apache.ibatis.abator.api.dom.xml.XmlElement;
 import org.apache.ibatis.abator.config.AbatorContext;
 import org.apache.ibatis.abator.config.GeneratedKey;
+import org.apache.ibatis.abator.config.PropertyRegistry;
 import org.apache.ibatis.abator.internal.db.ColumnDefinition;
 import org.apache.ibatis.abator.internal.util.StringUtility;
 import org.apache.ibatis.abator.internal.util.messages.Messages;
@@ -50,7 +52,7 @@
     /**
      * Contains any properties passed in from the SqlMap configuration element.
      */
-    protected Map properties;
+    protected Properties properties;
 
     /**
      * This is the target package from the SqlMap configuration element
@@ -82,7 +84,7 @@
     public SqlMapGeneratorIterateImpl() {
         super();
         tableStringMaps = new HashMap();
-        properties = new HashMap();
+        properties = new Properties();
     }
 
     private Map getTableStringMap(FullyQualifiedTable table) {
@@ -95,7 +97,7 @@
         return map;
     }
 
-    public void addConfigurationProperties(Map properties) {
+    public void addConfigurationProperties(Properties properties) {
         this.properties.putAll(properties);
     }
 
@@ -276,7 +278,7 @@
      */
     protected XmlElement getBaseResultMapElement(IntrospectedTable introspectedTable) {
         boolean useColumnIndex =
-            "true".equalsIgnoreCase(introspectedTable.getTableConfigurationProperty("useColumnIndexes")); //$NON-NLS-1$ //$NON-NLS-2$
+            "true".equalsIgnoreCase(introspectedTable.getTableConfigurationProperty(PropertyRegistry.TABLE_USE_COLUMN_INDEXES)); //$NON-NLS-1$
         XmlElement answer = new XmlElement("resultMap"); //$NON-NLS-1$
         FullyQualifiedTable table = introspectedTable.getTable();
         answer.addAttribute(new Attribute("id", //$NON-NLS-1$
@@ -295,7 +297,8 @@
         answer.addComment();
 
         int i = 1;
-        if (StringUtility.stringHasValue(introspectedTable.getSelectByPrimaryKeyQueryId())) {
+        if (StringUtility.stringHasValue(introspectedTable.getSelectByPrimaryKeyQueryId())
+                || StringUtility.stringHasValue(introspectedTable.getSelectByExampleQueryId())) {
             i++;
         }
         
@@ -339,7 +342,7 @@
      */
     protected XmlElement getResultMapWithBLOBsElement(IntrospectedTable introspectedTable) {
         boolean useColumnIndex =
-            "true".equalsIgnoreCase(introspectedTable.getTableConfigurationProperty("useColumnIndexes")); //$NON-NLS-1$ //$NON-NLS-2$
+            "true".equalsIgnoreCase(introspectedTable.getTableConfigurationProperty(PropertyRegistry.TABLE_USE_COLUMN_INDEXES)); //$NON-NLS-1$
 
         XmlElement answer = new XmlElement("resultMap"); //$NON-NLS-1$
         FullyQualifiedTable table = introspectedTable.getTable();
@@ -371,7 +374,8 @@
         answer.addComment();
 
         int i = introspectedTable.getNonBLOBColumnCount() + 1;
-        if (StringUtility.stringHasValue(introspectedTable.getSelectByPrimaryKeyQueryId())) {
+        if (StringUtility.stringHasValue(introspectedTable.getSelectByPrimaryKeyQueryId())
+                || StringUtility.stringHasValue(introspectedTable.getSelectByExampleQueryId())) {
             i++;
         }
         Iterator iter = introspectedTable.getBLOBColumns();
@@ -1005,7 +1009,7 @@
         s = (String) map.get(key);
         if (s == null) {
             StringBuffer sb = new StringBuffer(targetPackage);
-            if ("true".equalsIgnoreCase((String)properties.get("enableSubPackages"))) { //$NON-NLS-1$  //$NON-NLS-2$
+            if ("true".equalsIgnoreCase(properties.getProperty(PropertyRegistry.ANY_ENABLE_SUB_PACKAGES))) { //$NON-NLS-1$
                 sb.append(table.getSubPackage());
             }
             

Modified: ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/types/JavaTypeResolverDefaultImpl.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/types/JavaTypeResolverDefaultImpl.java?view=diff&rev=511167&r1=511166&r2=511167
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/types/JavaTypeResolverDefaultImpl.java (original)
+++ ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/types/JavaTypeResolverDefaultImpl.java Fri Feb 23 15:20:56 2007
@@ -18,13 +18,13 @@
 import java.math.BigDecimal;
 import java.sql.Types;
 import java.util.Date;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
+import java.util.Properties;
 
 import org.apache.ibatis.abator.api.JavaTypeResolver;
 import org.apache.ibatis.abator.api.dom.java.FullyQualifiedJavaType;
 import org.apache.ibatis.abator.config.AbatorContext;
+import org.apache.ibatis.abator.config.PropertyRegistry;
 import org.apache.ibatis.abator.exception.UnsupportedDataTypeException;
 import org.apache.ibatis.abator.internal.db.ColumnDefinition;
 
@@ -36,16 +36,16 @@
 
 	protected List warnings;
 	
-	protected Map properties;
+	protected Properties properties;
     
     protected AbatorContext abatorContext;
 
 	public JavaTypeResolverDefaultImpl() {
 		super();
-        properties = new HashMap();
+        properties = new Properties();
 	}
 
-    public void addConfigurationProperties(Map properties) {
+    public void addConfigurationProperties(Properties properties) {
         this.properties.putAll(properties);
     }
 
@@ -55,8 +55,8 @@
 	 */
 	public void initializeResolvedJavaType(ColumnDefinition cd)
 			throws UnsupportedDataTypeException {
-		boolean forceBigDecimals = "true".equalsIgnoreCase((String) properties //$NON-NLS-1$
-				.get("forceBigDecimals")); //$NON-NLS-1$
+		boolean forceBigDecimals = "true".equalsIgnoreCase(properties //$NON-NLS-1$
+				.getProperty(PropertyRegistry.TYPE_RESOLVER_FORCE_BIG_DECIMALS));
 
 		ResolvedJavaType type = new ResolvedJavaType();