ibatis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgbut...@apache.org
Subject svn commit: r465374 - in /ibatis/trunk/java/mapper/mapper2/tools/abator/core: build/ doc/ src/org/apache/ibatis/abator/config/ src/org/apache/ibatis/abator/internal/db/ src/org/apache/ibatis/abator/internal/java/dao/ src/org/apache/ibatis/abator/intern...
Date Wed, 18 Oct 2006 21:11:42 GMT
Author: jgbutler
Date: Wed Oct 18 14:11:40 2006
New Revision: 465374

URL: http://svn.apache.org/viewvc?view=rev&rev=465374
Log:
Abator - add hook methods to enable further customization of generated objects, add support
for persisting a configuration to XML

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/src/org/apache/ibatis/abator/config/AbatorConfiguration.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/ColumnOverride.java
    ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/DAOGeneratorConfiguration.java
    ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/GeneratedKey.java
    ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/JDBCConnectionConfiguration.java
    ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/JavaModelGeneratorConfiguration.java
    ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/JavaTypeResolverConfiguration.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/config/SqlMapGeneratorConfiguration.java
    ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/TableConfiguration.java
    ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/TypedPropertyHolder.java
    ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/db/ColumnDefinition.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/dao/BaseLegacyDAOGenerator.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/sqlmap/XmlConstants.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=465374&r1=465373&r2=465374
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/tools/abator/core/build/version.properties (original)
+++ ibatis/trunk/java/mapper/mapper2/tools/abator/core/build/version.properties Wed Oct 18
14:11:40 2006
@@ -1,4 +1,4 @@
 #Abator build version info
-#Mon Oct 02 17:19:55 CDT 2006
+#Wed Oct 18 16:05:02 CDT 2006
 version=1.0.1
-buildNum=282
+buildNum=284

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=465374&r1=465373&r2=465374
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/tools/abator/core/doc/ReleaseNotes.txt (original)
+++ ibatis/trunk/java/mapper/mapper2/tools/abator/core/doc/ReleaseNotes.txt Wed Oct 18 14:11:40
2006
@@ -12,6 +12,11 @@
    generator sets
 3. Add support for "ignoreQualifiersAtRuntime" and "runtimeTableName" on
    the <table> configuration
+4. Added support for persisting a configuration to XML - this to enable
+   a graphical editor in the future
+5. Add afterXXXGenerationHook() methods in all generators to enable adding
+   extra Java code or XML elements to any generated object.  Will make it
+   easier to create customized generators
 
 -------------------------------------------------------------------------------
 Version 1.0.0:

Modified: ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/AbatorConfiguration.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/AbatorConfiguration.java?view=diff&rev=465374&r1=465373&r2=465374
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/AbatorConfiguration.java
(original)
+++ ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/AbatorConfiguration.java
Wed Oct 18 14:11:40 2006
@@ -19,7 +19,10 @@
 import java.util.Iterator;
 import java.util.List;
 
+import org.apache.ibatis.abator.api.dom.xml.Document;
+import org.apache.ibatis.abator.api.dom.xml.XmlElement;
 import org.apache.ibatis.abator.exception.InvalidConfigurationException;
+import org.apache.ibatis.abator.internal.sqlmap.XmlConstants;
 import org.apache.ibatis.abator.internal.util.messages.Messages;
 
 /**
@@ -66,5 +69,30 @@
     
     public void addAbatorContext(AbatorContext abatorContext) {
         abatorContexts.add(abatorContext);
+    }
+    
+    /**
+     * Builds an XML representation of this configuration.  This
+     * can be used to persist a programtically generated
+     * configuration.
+     *  
+     * @return the XML representation of this configuration
+     */
+    public Document toDocument() {
+        // note that this method will not reconstruct a properties
+        // element - that element is only used in XML parsing
+        
+        Document document = new Document(XmlConstants.ABATOR_CONFIG_PUBLIC_ID,
+                XmlConstants.ABATOR_CONFIG_SYSTEM_ID);
+        XmlElement rootElement = new XmlElement("abatorConfiguration"); //$NON-NLS-1$
+        document.setRootElement(rootElement);
+        
+        Iterator iter = abatorContexts.iterator();
+        while (iter.hasNext()) {
+            AbatorContext abatorContext = (AbatorContext) iter.next();
+            rootElement.addElement(abatorContext.toXmlElement());
+        }
+        
+        return document;
     }
 }

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=465374&r1=465373&r2=465374
==============================================================================
--- 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
Wed Oct 18 14:11:40 2006
@@ -28,6 +28,8 @@
 import org.apache.ibatis.abator.api.JavaTypeResolver;
 import org.apache.ibatis.abator.api.ProgressCallback;
 import org.apache.ibatis.abator.api.SqlMapGenerator;
+import org.apache.ibatis.abator.api.dom.xml.Attribute;
+import org.apache.ibatis.abator.api.dom.xml.XmlElement;
 import org.apache.ibatis.abator.exception.InvalidConfigurationException;
 import org.apache.ibatis.abator.internal.AbatorObjectFactory;
 import org.apache.ibatis.abator.internal.NullProgressCallback;
@@ -57,6 +59,8 @@
     private GeneratorSet generatorSet;
     
     private ModelType defaultModelType;
+    
+    private String configuredGeneratorSet;
 	
     /**
      * Constructs an AbatorContext object.
@@ -66,6 +70,9 @@
      */
     public AbatorContext(String generatorSetType, ModelType defaultModelType) {
         super();
+        
+        this.configuredGeneratorSet = generatorSetType;
+        
         if (defaultModelType == null) {
             this.defaultModelType = ModelType.CONDITIONAL;
         } else {
@@ -196,7 +203,7 @@
 
 		if (tc.getGeneratedKey() != null
 				&& !StringUtility.stringHasValue(tc.getGeneratedKey()
-						.getSqlStatement())) {
+						.getRuntimeSqlStatement())) {
             String tableName = StringUtility.composeFullyQualifiedTableName(
                     tc.getCatalog(), tc.getSchema(), tc.getTableName(), '.');
 	        errors
@@ -343,5 +350,51 @@
 
     public ModelType getDefaultModelType() {
         return defaultModelType;
+    }
+
+    /**
+     * Builds an XmlElement representation of this context.  Note that the
+     * XML may not necessarity validate if the context is invalid.  Call the
+     * <code>validate</code> method to check validity of this context.
+     * 
+     * @return the XML representation of this context
+     */
+    public XmlElement toXmlElement() {
+        XmlElement xmlElement = new XmlElement("abatorContext"); //$NON-NLS-1$
+        xmlElement.addAttribute(new Attribute("defaultModelType", defaultModelType.getModelType()));
//$NON-NLS-1$
+        
+        if (StringUtility.stringHasValue(configuredGeneratorSet)) {
+            xmlElement.addAttribute(new Attribute("generatorSet", configuredGeneratorSet));
//$NON-NLS-1$
+        }
+        
+        addPropertyXmlElements(xmlElement);
+        
+        if (jdbcConnectionConfiguration != null) {
+            xmlElement.addElement(jdbcConnectionConfiguration.toXmlElement());
+        }
+        
+        if (javaTypeResolverConfiguration != null) {
+            xmlElement.addElement(javaTypeResolverConfiguration.toXmlElement());
+        }
+        
+        if (javaModelGeneratorConfiguration != null) {
+            xmlElement.addElement(javaModelGeneratorConfiguration.toXmlElement());
+        }
+        
+        if (sqlMapGeneratorConfiguration != null) {
+            xmlElement.addElement(sqlMapGeneratorConfiguration.toXmlElement());
+        }
+        
+        if (daoGeneratorConfiguration != null) {
+            xmlElement.addElement(daoGeneratorConfiguration.toXmlElement());
+        }
+        
+        Iterator iter = tableConfigurations.iterator();
+        while (iter.hasNext()) {
+            TableConfiguration tableConfiguration = (TableConfiguration) iter.next();
+            xmlElement.addElement(tableConfiguration.toXmlElement());
+        }
+        
+        return xmlElement;
     }
 }

Modified: ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/ColumnOverride.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/ColumnOverride.java?view=diff&rev=465374&r1=465373&r2=465374
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/ColumnOverride.java
(original)
+++ ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/ColumnOverride.java
Wed Oct 18 14:11:40 2006
@@ -15,6 +15,10 @@
  */
 package org.apache.ibatis.abator.config;
 
+import org.apache.ibatis.abator.api.dom.xml.Attribute;
+import org.apache.ibatis.abator.api.dom.xml.XmlElement;
+import org.apache.ibatis.abator.internal.util.StringUtility;
+
 /**
  * @author Jeff Butler
  */
@@ -75,5 +79,28 @@
 
     public void setTypeHandler(String typeHandler) {
         this.typeHandler = typeHandler;
+    }
+    
+    public XmlElement toXmlElement() {
+        XmlElement xmlElement = new XmlElement("columnOverride"); //$NON-NLS-1$
+        xmlElement.addAttribute(new Attribute("column", columnName)); //$NON-NLS-1$
+        
+        if (StringUtility.stringHasValue(javaProperty)) {
+            xmlElement.addAttribute(new Attribute("property", javaProperty)); //$NON-NLS-1$
+        }
+        
+        if (StringUtility.stringHasValue(javaType)) {
+            xmlElement.addAttribute(new Attribute("javaType", javaType)); //$NON-NLS-1$
+        }
+        
+        if (StringUtility.stringHasValue(jdbcType)) {
+            xmlElement.addAttribute(new Attribute("jdbcType", jdbcType)); //$NON-NLS-1$
+        }
+        
+        if (StringUtility.stringHasValue(typeHandler)) {
+            xmlElement.addAttribute(new Attribute("typeHandler", typeHandler)); //$NON-NLS-1$
+        }
+        
+        return xmlElement;
     }
 }

Modified: ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/DAOGeneratorConfiguration.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/DAOGeneratorConfiguration.java?view=diff&rev=465374&r1=465373&r2=465374
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/DAOGeneratorConfiguration.java
(original)
+++ ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/DAOGeneratorConfiguration.java
Wed Oct 18 14:11:40 2006
@@ -15,6 +15,9 @@
  */
 package org.apache.ibatis.abator.config;
 
+import org.apache.ibatis.abator.api.dom.xml.Attribute;
+import org.apache.ibatis.abator.api.dom.xml.XmlElement;
+
 
 /**
  * @author Jeff Butler
@@ -46,4 +49,23 @@
 	public void setTargetPackage(String targetPackage) {
 		this.targetPackage = targetPackage;
 	}
+
+    public XmlElement toXmlElement() {
+        XmlElement answer = new XmlElement("daoGenerator"); //$NON-NLS-1$
+        if (getConfigurationType() != null) {
+            answer.addAttribute(new Attribute("type", getConfigurationType())); //$NON-NLS-1$
+        }
+        
+        if (targetPackage != null) {
+            answer.addAttribute(new Attribute("targetPackage", targetPackage)); //$NON-NLS-1$
+        }
+        
+        if (targetProject != null) {
+            answer.addAttribute(new Attribute("targetProject", targetProject)); //$NON-NLS-1$
+        }
+        
+        addPropertyXmlElements(answer);
+        
+        return answer;
+    }
 }

Modified: ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/GeneratedKey.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/GeneratedKey.java?view=diff&rev=465374&r1=465373&r2=465374
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/GeneratedKey.java
(original)
+++ ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/GeneratedKey.java
Wed Oct 18 14:11:40 2006
@@ -15,6 +15,8 @@
  */
 package org.apache.ibatis.abator.config;
 
+import org.apache.ibatis.abator.api.dom.xml.Attribute;
+import org.apache.ibatis.abator.api.dom.xml.XmlElement;
 import org.apache.ibatis.abator.internal.db.DatabaseDialects;
 
 /**
@@ -26,38 +28,41 @@
 public class GeneratedKey {
     private String column;
 
-    private String sqlStatement;
+    private String configuredSqlStatement;
 
+    private String runtimeSqlStatement;
+    
     private boolean isIdentity;
 
     /**
      * 
      */
-    public GeneratedKey(String column, String sqlStatement, boolean isIdentity) {
+    public GeneratedKey(String column, String configuredSqlStatement, boolean isIdentity)
{
         super();
         this.column = column;
         this.isIdentity = isIdentity;
+        this.configuredSqlStatement = configuredSqlStatement;
 
-        if ("DB2".equalsIgnoreCase(sqlStatement)) { //$NON-NLS-1$
-            this.sqlStatement = DatabaseDialects
+        if ("DB2".equalsIgnoreCase(configuredSqlStatement)) { //$NON-NLS-1$
+            this.runtimeSqlStatement = DatabaseDialects
                     .getIdentityClause(DatabaseDialects.DB2);
-        } else if ("MySQL".equalsIgnoreCase(sqlStatement)) { //$NON-NLS-1$
-            this.sqlStatement = DatabaseDialects
+        } else if ("MySQL".equalsIgnoreCase(configuredSqlStatement)) { //$NON-NLS-1$
+            this.runtimeSqlStatement = DatabaseDialects
                     .getIdentityClause(DatabaseDialects.MYSQL);
-        } else if ("SqlServer".equalsIgnoreCase(sqlStatement)) { //$NON-NLS-1$
-            this.sqlStatement = DatabaseDialects
+        } else if ("SqlServer".equalsIgnoreCase(configuredSqlStatement)) { //$NON-NLS-1$
+            this.runtimeSqlStatement = DatabaseDialects
                     .getIdentityClause(DatabaseDialects.SQLSERVER);
-        } else if ("Cloudscape".equalsIgnoreCase(sqlStatement)) { //$NON-NLS-1$
-            this.sqlStatement = DatabaseDialects
+        } else if ("Cloudscape".equalsIgnoreCase(configuredSqlStatement)) { //$NON-NLS-1$
+            this.runtimeSqlStatement = DatabaseDialects
                     .getIdentityClause(DatabaseDialects.CLOUDSCAPE);
-        } else if ("Derby".equalsIgnoreCase(sqlStatement)) { //$NON-NLS-1$
-            this.sqlStatement = DatabaseDialects
+        } else if ("Derby".equalsIgnoreCase(configuredSqlStatement)) { //$NON-NLS-1$
+            this.runtimeSqlStatement = DatabaseDialects
                     .getIdentityClause(DatabaseDialects.DERBY);
-        } else if ("HSQLDB".equalsIgnoreCase(sqlStatement)) { //$NON-NLS-1$
-            this.sqlStatement = DatabaseDialects
+        } else if ("HSQLDB".equalsIgnoreCase(configuredSqlStatement)) { //$NON-NLS-1$
+            this.runtimeSqlStatement = DatabaseDialects
                     .getIdentityClause(DatabaseDialects.HSQLDB);
         } else {
-            this.sqlStatement = sqlStatement;
+            this.runtimeSqlStatement = configuredSqlStatement;
         }
     }
 
@@ -69,7 +74,17 @@
         return isIdentity;
     }
 
-    public String getSqlStatement() {
-        return sqlStatement;
+    public String getRuntimeSqlStatement() {
+        return runtimeSqlStatement;
+    }
+    
+    public XmlElement toXmlElement() {
+        XmlElement xmlElement = new XmlElement("generatedKey"); //$NON-NLS-1$
+        xmlElement.addAttribute(new Attribute("column", column)); //$NON-NLS-1$
+        xmlElement.addAttribute(new Attribute("sqlStatement", configuredSqlStatement)); //$NON-NLS-1$
+        xmlElement.addAttribute(new Attribute("identity",//$NON-NLS-1$
+                isIdentity ? "true" : "false")); //$NON-NLS-1$ //$NON-NLS-2$
+        
+        return xmlElement;
     }
 }

Modified: ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/JDBCConnectionConfiguration.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/JDBCConnectionConfiguration.java?view=diff&rev=465374&r1=465373&r2=465374
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/JDBCConnectionConfiguration.java
(original)
+++ ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/JDBCConnectionConfiguration.java
Wed Oct 18 14:11:40 2006
@@ -16,8 +16,13 @@
 package org.apache.ibatis.abator.config;
 
 import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
 
+import org.apache.ibatis.abator.api.dom.xml.Attribute;
+import org.apache.ibatis.abator.api.dom.xml.XmlElement;
+import org.apache.ibatis.abator.internal.util.StringUtility;
+
 /**
  * 
  * @author Jeff Butler
@@ -81,4 +86,30 @@
 	public void setDriverClass(String driverClass) {
 		this.driverClass = driverClass;
 	}
+    
+    public XmlElement toXmlElement() {
+        XmlElement xmlElement = new XmlElement("jdbcConnection"); //$NON-NLS-1$
+        xmlElement.addAttribute(new Attribute("driverClass", driverClass)); //$NON-NLS-1$
+        xmlElement.addAttribute(new Attribute("connectionURL", connectionURL)); //$NON-NLS-1$
+        
+        if (StringUtility.stringHasValue(userId)) {
+            xmlElement.addAttribute(new Attribute("userId", userId)); //$NON-NLS-1$
+        }
+        
+        if (StringUtility.stringHasValue(password)) {
+            xmlElement.addAttribute(new Attribute("password", password)); //$NON-NLS-1$
+        }
+        
+        Iterator iter = classPathEntries.iterator();
+        while (iter.hasNext()) {
+            String classPathEntry = (String) iter.next();
+            XmlElement cpeElement = new XmlElement("classPathEntry"); //$NON-NLS-1$
+            cpeElement.addAttribute(new Attribute("location", classPathEntry)); //$NON-NLS-1$
+            xmlElement.addElement(cpeElement);
+        }
+        
+        addPropertyXmlElements(xmlElement);
+        
+        return xmlElement;
+    }
 }

Modified: ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/JavaModelGeneratorConfiguration.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/JavaModelGeneratorConfiguration.java?view=diff&rev=465374&r1=465373&r2=465374
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/JavaModelGeneratorConfiguration.java
(original)
+++ ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/JavaModelGeneratorConfiguration.java
Wed Oct 18 14:11:40 2006
@@ -15,6 +15,9 @@
  */
 package org.apache.ibatis.abator.config;
 
+import org.apache.ibatis.abator.api.dom.xml.Attribute;
+import org.apache.ibatis.abator.api.dom.xml.XmlElement;
+
 
 /**
  * @author Jeff Butler
@@ -46,5 +49,24 @@
 
     public void setTargetPackage(String targetPackage) {
         this.targetPackage = targetPackage;
+    }
+
+    public XmlElement toXmlElement() {
+        XmlElement answer = new XmlElement("javaModelGenerator"); //$NON-NLS-1$
+        if (getConfigurationType() != null) {
+            answer.addAttribute(new Attribute("type", getConfigurationType())); //$NON-NLS-1$
+        }
+        
+        if (targetPackage != null) {
+            answer.addAttribute(new Attribute("targetPackage", targetPackage)); //$NON-NLS-1$
+        }
+        
+        if (targetProject != null) {
+            answer.addAttribute(new Attribute("targetProject", targetProject)); //$NON-NLS-1$
+        }
+        
+        addPropertyXmlElements(answer);
+        
+        return answer;
     }
 }

Modified: ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/JavaTypeResolverConfiguration.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/JavaTypeResolverConfiguration.java?view=diff&rev=465374&r1=465373&r2=465374
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/JavaTypeResolverConfiguration.java
(original)
+++ ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/JavaTypeResolverConfiguration.java
Wed Oct 18 14:11:40 2006
@@ -15,6 +15,9 @@
  */
 package org.apache.ibatis.abator.config;
 
+import org.apache.ibatis.abator.api.dom.xml.Attribute;
+import org.apache.ibatis.abator.api.dom.xml.XmlElement;
+
 /**
  * @author Jeff Butler
  */
@@ -26,4 +29,15 @@
 	public JavaTypeResolverConfiguration() {
 		super();
 	}
+    
+    public XmlElement toXmlElement() {
+        XmlElement answer = new XmlElement("javaTypeResolver"); //$NON-NLS-1$
+        if (getConfigurationType() != null) {
+            answer.addAttribute(new Attribute("type", getConfigurationType())); //$NON-NLS-1$
+        }
+        
+        addPropertyXmlElements(answer);
+        
+        return answer;
+    }
 }

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=465374&r1=465373&r2=465374
==============================================================================
--- 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
Wed Oct 18 14:11:40 2006
@@ -16,8 +16,12 @@
 package org.apache.ibatis.abator.config;
 
 import java.util.HashMap;
+import java.util.Iterator;
 import java.util.Map;
 
+import org.apache.ibatis.abator.api.dom.xml.Attribute;
+import org.apache.ibatis.abator.api.dom.xml.XmlElement;
+
 /**
  * @author Jeff Butler
  */
@@ -39,4 +43,15 @@
 	public Map getProperties() {
 		return properties;
 	}
+    
+    protected void addPropertyXmlElements(XmlElement xmlElement) {
+        Iterator iter = properties.entrySet().iterator();
+        while (iter.hasNext()) {
+            Map.Entry entry = (Map.Entry) iter.next();
+            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$
+            xmlElement.addElement(propertyElement);
+        }
+    }
 }

Modified: ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/SqlMapGeneratorConfiguration.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/SqlMapGeneratorConfiguration.java?view=diff&rev=465374&r1=465373&r2=465374
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/SqlMapGeneratorConfiguration.java
(original)
+++ ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/SqlMapGeneratorConfiguration.java
Wed Oct 18 14:11:40 2006
@@ -15,6 +15,9 @@
  */
 package org.apache.ibatis.abator.config;
 
+import org.apache.ibatis.abator.api.dom.xml.Attribute;
+import org.apache.ibatis.abator.api.dom.xml.XmlElement;
+
 
 /**
  * @author Jeff Butler
@@ -46,4 +49,23 @@
 	public void setTargetPackage(String targetPackage) {
 		this.targetPackage = targetPackage;
 	}
+
+    public XmlElement toXmlElement() {
+        XmlElement answer = new XmlElement("sqlMapGenerator"); //$NON-NLS-1$
+        if (getConfigurationType() != null) {
+            answer.addAttribute(new Attribute("type", getConfigurationType())); //$NON-NLS-1$
+        }
+        
+        if (targetPackage != null) {
+            answer.addAttribute(new Attribute("targetPackage", targetPackage)); //$NON-NLS-1$
+        }
+        
+        if (targetProject != null) {
+            answer.addAttribute(new Attribute("targetProject", targetProject)); //$NON-NLS-1$
+        }
+        
+        addPropertyXmlElements(answer);
+        
+        return answer;
+    }
 }

Modified: ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/TableConfiguration.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/TableConfiguration.java?view=diff&rev=465374&r1=465373&r2=465374
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/TableConfiguration.java
(original)
+++ ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/TableConfiguration.java
Wed Oct 18 14:11:40 2006
@@ -21,8 +21,11 @@
 import java.util.List;
 import java.util.Map;
 
+import org.apache.ibatis.abator.api.dom.xml.Attribute;
+import org.apache.ibatis.abator.api.dom.xml.XmlElement;
 import org.apache.ibatis.abator.internal.util.EqualsUtil;
 import org.apache.ibatis.abator.internal.util.HashCodeUtil;
+import org.apache.ibatis.abator.internal.util.StringUtility;
 
 /**
  * 
@@ -298,5 +301,92 @@
 
     public void setWildcardEscapingEnabled(boolean wildcardEscapingEnabled) {
         this.wildcardEscapingEnabled = wildcardEscapingEnabled;
+    }
+    
+    public XmlElement toXmlElement() {
+        XmlElement xmlElement = new XmlElement("table"); //$NON-NLS-1$
+        xmlElement.addAttribute(new Attribute("tableName", tableName)); //$NON-NLS-1$
+        
+        if (StringUtility.stringHasValue(catalog)) {
+            xmlElement.addAttribute(new Attribute("catalog", catalog)); //$NON-NLS-1$
+        }
+        
+        if (StringUtility.stringHasValue(schema)) {
+            xmlElement.addAttribute(new Attribute("schema", schema)); //$NON-NLS-1$
+        }
+        
+        if (StringUtility.stringHasValue(alias)) {
+            xmlElement.addAttribute(new Attribute("alias", alias)); //$NON-NLS-1$
+        }
+        
+        if (StringUtility.stringHasValue(domainObjectName)) {
+            xmlElement.addAttribute(new Attribute("domainObjectName", domainObjectName));
//$NON-NLS-1$
+        }
+        
+        if (!insertStatementEnabled) {
+            xmlElement.addAttribute(new Attribute("enableInsert", "false")); //$NON-NLS-1$
//$NON-NLS-2$
+        }
+        
+        if (!selectByPrimaryKeyStatementEnabled) {
+            xmlElement.addAttribute(new Attribute("enableSelectByPrimaryKey", "false"));
//$NON-NLS-1$ //$NON-NLS-2$
+        }
+        
+        if (!selectByExampleStatementEnabled) {
+            xmlElement.addAttribute(new Attribute("enableSelectByExample", "false")); //$NON-NLS-1$
//$NON-NLS-2$
+        }
+        
+        if (!updateByPrimaryKeyStatementEnabled) {
+            xmlElement.addAttribute(new Attribute("enableUpdateByPrimaryKey", "false"));
//$NON-NLS-1$ //$NON-NLS-2$
+        }
+        
+        if (!deleteByPrimaryKeyStatementEnabled) {
+            xmlElement.addAttribute(new Attribute("enableDeleteByPrimaryKey", "false"));
//$NON-NLS-1$ //$NON-NLS-2$
+        }
+        
+        if (!deleteByExampleStatementEnabled) {
+            xmlElement.addAttribute(new Attribute("enableDeleteByExample", "false")); //$NON-NLS-1$
//$NON-NLS-2$
+        }
+
+        if (StringUtility.stringHasValue(selectByPrimaryKeyQueryId)) {
+            xmlElement.addAttribute(new Attribute("selectByPrimaryKeyQueryId", selectByPrimaryKeyQueryId));
//$NON-NLS-1$
+        }
+        
+        if (StringUtility.stringHasValue(selectByExampleQueryId)) {
+            xmlElement.addAttribute(new Attribute("selectByExampleQueryId", selectByExampleQueryId));
//$NON-NLS-1$
+        }
+        
+        if (modelType != null) {
+            xmlElement.addAttribute(new Attribute("modelType", modelType.getModelType()));
//$NON-NLS-1$
+        }
+        
+        if (wildcardEscapingEnabled) {
+            xmlElement.addAttribute(new Attribute("escapeWildcards", "true")); //$NON-NLS-1$
//$NON-NLS-2$
+        }
+        
+        addPropertyXmlElements(xmlElement);
+        
+        if (generatedKey != null) {
+            xmlElement.addElement(generatedKey.toXmlElement());
+        }
+        
+        if (ignoredColumns.size() > 0) {
+            Iterator iter = ignoredColumns.keySet().iterator();
+            while (iter.hasNext()) {
+                String column = (String) iter.next();
+                XmlElement ignoreColumn = new XmlElement("ignoreColumn"); //$NON-NLS-1$
+                ignoreColumn.addAttribute(new Attribute("column", column)); //$NON-NLS-1$
+                xmlElement.addElement(ignoreColumn);
+            }
+        }
+        
+        if (columnOverrides.size() > 0) {
+            Iterator iter = columnOverrides.values().iterator();
+            while (iter.hasNext()) {
+                ColumnOverride columnOverride = (ColumnOverride) iter.next();
+                xmlElement.addElement(columnOverride.toXmlElement());
+            }
+        }
+        
+        return xmlElement;
     }
 }

Modified: ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/TypedPropertyHolder.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/TypedPropertyHolder.java?view=diff&rev=465374&r1=465373&r2=465374
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/TypedPropertyHolder.java
(original)
+++ ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/TypedPropertyHolder.java
Wed Oct 18 14:11:40 2006
@@ -15,6 +15,7 @@
  */
 package org.apache.ibatis.abator.config;
 
+
 /**
  * @author Jeff Butler
  */

Modified: ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/db/ColumnDefinition.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/db/ColumnDefinition.java?view=diff&rev=465374&r1=465373&r2=465374
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/db/ColumnDefinition.java
(original)
+++ ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/db/ColumnDefinition.java
Wed Oct 18 14:11:40 2006
@@ -292,14 +292,14 @@
     }
     
     private String escapeStringForIbatis(String actualColumnName) {
-        StringTokenizer st = new StringTokenizer(actualColumnName, "$#", true);
+        StringTokenizer st = new StringTokenizer(actualColumnName, "$#", true); //$NON-NLS-1$
         StringBuffer sb = new StringBuffer();
         while (st.hasMoreTokens()) {
             String token = st.nextToken();
-            if ("$".equals(token)) {
-                sb.append("$$");
-            } else if ("#".equals(token)) {
-                sb.append("##");
+            if ("$".equals(token)) { //$NON-NLS-1$
+                sb.append("$$"); //$NON-NLS-1$
+            } else if ("#".equals(token)) { //$NON-NLS-1$
+                sb.append("##"); //$NON-NLS-1$
             } else {
                 sb.append(token);
             }

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=465374&r1=465373&r2=465374
==============================================================================
--- 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
Wed Oct 18 14:11:40 2006
@@ -359,29 +359,33 @@
             }
         }
 
-        methods = getExtraImplementationMethods(introspectedTable, answer);
-        if (methods != null) {
-            iter = methods.iterator();
-            while (iter.hasNext()) {
-                answer.addMethod((Method) iter.next());
-            }
-        }
+        afterImplementationGenerationHook(introspectedTable, answer);
         
         return answer;
     }
 
     /**
-     * Override this method to provide any extra methods needed in the 
-     * implementation class.
+     * Override this method to provide any extra customization of 
+     * the generated interface.
+     * 
+     * @param introspectedTable
+     * @param generatedInterface the generated interface
+     */
+    protected void afterInterfaceGenerationHook(IntrospectedTable introspectedTable,
+            Interface generatedInterface) {
+        return;
+    }
+    
+    /**
+     * Override this method to provide any extra customization of 
+     * the generated implementation class.
      * 
      * @param introspectedTable
-     * @param compilationUnit
-     * @return a list of Method objects that will be added to the implementation
-     *  class.  May be <code>null</code>.
+     * @param generatedClass the generated class
      */
-    protected List getExtraImplementationMethods(IntrospectedTable introspectedTable,
-            CompilationUnit compilationUnit) {
-        return null;
+    protected void afterImplementationGenerationHook(IntrospectedTable introspectedTable,
+            TopLevelClass generatedClass) {
+        return;
     }
 
     protected Interface getDAOInterface(IntrospectedTable introspectedTable) {
@@ -496,6 +500,8 @@
             }
         }
 
+        afterInterfaceGenerationHook(introspectedTable, answer);
+        
         return answer;
     }
 

Modified: ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/java/dao/BaseLegacyDAOGenerator.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/java/dao/BaseLegacyDAOGenerator.java?view=diff&rev=465374&r1=465373&r2=465374
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/java/dao/BaseLegacyDAOGenerator.java
(original)
+++ ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/java/dao/BaseLegacyDAOGenerator.java
Wed Oct 18 14:11:40 2006
@@ -29,6 +29,7 @@
 import org.apache.ibatis.abator.api.dom.java.JavaVisibility;
 import org.apache.ibatis.abator.api.dom.java.Method;
 import org.apache.ibatis.abator.api.dom.java.Parameter;
+import org.apache.ibatis.abator.api.dom.java.TopLevelClass;
 import org.apache.ibatis.abator.internal.db.ColumnDefinition;
 import org.apache.ibatis.abator.internal.sqlmap.ExampleClause;
 import org.apache.ibatis.abator.internal.util.JavaBeansUtil;
@@ -246,22 +247,20 @@
         return answer;
     }
 
-    protected List getExtraImplementationMethods(
+    protected void afterImplementationGenerationHook(
             IntrospectedTable introspectedTable,
-            CompilationUnit compilationUnit) {
+            TopLevelClass generatedClass) {
 
         if (!introspectedTable.getRules().generateExampleClass()) {
-            return null;
+            return;
         }
 
-        ArrayList answer = new ArrayList();
-
         FullyQualifiedTable table = introspectedTable.getTable();
         FullyQualifiedJavaType type = javaModelGenerator.getExampleType(table);
         
-        compilationUnit.addImportedType(FullyQualifiedJavaType.getNewMapInstance());
-        compilationUnit.addImportedType(FullyQualifiedJavaType.getNewHashMapInstance());
-        compilationUnit.addImportedType(type);
+        generatedClass.addImportedType(FullyQualifiedJavaType.getNewMapInstance());
+        generatedClass.addImportedType(FullyQualifiedJavaType.getNewHashMapInstance());
+        generatedClass.addImportedType(type);
 
         Method method = new Method();
         method.addComment(table);
@@ -282,7 +281,7 @@
 
             Method method1 = getExampleParmsMethod(cd, table);
             if (method1 != null) {
-                answer.add(method1);
+                generatedClass.addMethod(method1);
 
                 sb.setLength(0);
                 sb.append("parms.putAll("); //$NON-NLS-1$
@@ -294,9 +293,7 @@
 
         method.addBodyLine("return parms;"); //$NON-NLS-1$
 
-        answer.add(method);
-
-        return answer;
+        generatedClass.addMethod(method);
     }
 
     /**

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=465374&r1=465373&r2=465374
==============================================================================
--- 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
Wed Oct 18 14:11:40 2006
@@ -27,7 +27,6 @@
 import org.apache.ibatis.abator.api.JavaModelGenerator;
 import org.apache.ibatis.abator.api.ProgressCallback;
 import org.apache.ibatis.abator.api.dom.OutputUtilities;
-import org.apache.ibatis.abator.api.dom.java.CompilationUnit;
 import org.apache.ibatis.abator.api.dom.java.Field;
 import org.apache.ibatis.abator.api.dom.java.FullyQualifiedJavaType;
 import org.apache.ibatis.abator.api.dom.java.InnerClass;
@@ -240,7 +239,7 @@
         return s;
     }
 
-    protected CompilationUnit getPrimaryKey(IntrospectedTable introspectedTable) {
+    protected TopLevelClass getPrimaryKey(IntrospectedTable introspectedTable) {
 
         if (!introspectedTable.getRules().generatePrimaryKeyClass()) {
             return null;
@@ -262,7 +261,7 @@
         return answer;
     }
 
-    protected CompilationUnit getBaseRecord(IntrospectedTable introspectedTable) {
+    protected TopLevelClass getBaseRecord(IntrospectedTable introspectedTable) {
 
         if (!introspectedTable.getRules().generateBaseRecordClass()) {
             return null;
@@ -298,7 +297,7 @@
         return answer;
     }
 
-    protected CompilationUnit getRecordWithBLOBs(IntrospectedTable introspectedTable) {
+    protected TopLevelClass getRecordWithBLOBs(IntrospectedTable introspectedTable) {
 
         if (!introspectedTable.getRules().generateRecordWithBLOBsClass()) {
             return null;
@@ -361,42 +360,94 @@
         callback.startSubTask(Messages.getString(
                 "Progress.6", //$NON-NLS-1$
                 tableName));
-        CompilationUnit cu = getExample(introspectedTable);
-        if (cu != null) {
-            GeneratedJavaFile gjf = new GeneratedJavaFile(cu, targetProject);
+        TopLevelClass tlc = getExample(introspectedTable);
+        if (tlc != null) {
+            afterExampleGenerationHook(introspectedTable, tlc);
+            GeneratedJavaFile gjf = new GeneratedJavaFile(tlc, targetProject);
             list.add(gjf);
         }
 
         callback.startSubTask(Messages.getString(
                 "Progress.7", //$NON-NLS-1$
                 tableName));
-        cu = getPrimaryKey(introspectedTable);
-        if (cu != null) {
-            GeneratedJavaFile gjf = new GeneratedJavaFile(cu, targetProject);
+        tlc = getPrimaryKey(introspectedTable);
+        if (tlc != null) {
+            afterPrimaryKeyGenerationHook(introspectedTable, tlc);
+            GeneratedJavaFile gjf = new GeneratedJavaFile(tlc, targetProject);
             list.add(gjf);
         }
 
         callback.startSubTask(Messages.getString(
                 "Progress.8", //$NON-NLS-1$
                 tableName));
-        cu = getBaseRecord(introspectedTable);
-        if (cu != null) {
-            GeneratedJavaFile gjf = new GeneratedJavaFile(cu, targetProject);
+        tlc = getBaseRecord(introspectedTable);
+        if (tlc != null) {
+            afterBaseRecordGenerationHook(introspectedTable, tlc);
+            GeneratedJavaFile gjf = new GeneratedJavaFile(tlc, targetProject);
             list.add(gjf);
         }
 
         callback.startSubTask(Messages.getString(
                 "Progress.9", //$NON-NLS-1$
                 tableName));
-        cu = getRecordWithBLOBs(introspectedTable);
-        if (cu != null) {
-            GeneratedJavaFile gjf = new GeneratedJavaFile(cu, targetProject);
+        tlc = getRecordWithBLOBs(introspectedTable);
+        if (tlc != null) {
+            afterRecordWithBLOBsGenerationHook(introspectedTable, tlc);
+            GeneratedJavaFile gjf = new GeneratedJavaFile(tlc, targetProject);
             list.add(gjf);
         }
 
         return list;
     }
 
+    /**
+     * Override this method to provide any extra customization needed
+     * in the generated example class
+     * 
+     * @param introspectedTable
+     * @param topLevelClass
+     */
+    protected void afterExampleGenerationHook(IntrospectedTable introspectedTable,
+            TopLevelClass topLevelClass) {
+        return;
+    }
+
+    /**
+     * Override this method to provide any extra customization needed
+     * in the generated primary key class
+     * 
+     * @param introspectedTable
+     * @param topLevelClass
+     */
+    protected void afterPrimaryKeyGenerationHook(IntrospectedTable introspectedTable,
+            TopLevelClass topLevelClass) {
+        return;
+    }
+
+    /**
+     * Override this method to provide any extra customization needed
+     * in the generated base record class
+     * 
+     * @param introspectedTable
+     * @param topLevelClass
+     */
+    protected void afterBaseRecordGenerationHook(IntrospectedTable introspectedTable,
+            TopLevelClass topLevelClass) {
+        return;
+    }
+    
+    /**
+     * Override this method to provide any extra customization needed
+     * in the generated base record class
+     * 
+     * @param introspectedTable
+     * @param topLevelClass
+     */
+    protected void afterRecordWithBLOBsGenerationHook(IntrospectedTable introspectedTable,
+            TopLevelClass topLevelClass) {
+        return;
+    }
+    
     /*
      * (non-Javadoc)
      * 

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=465374&r1=465373&r2=465374
==============================================================================
--- 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
Wed Oct 18 14:11:40 2006
@@ -147,6 +147,8 @@
         Document document = new Document(XmlConstants.SQL_MAP_PUBLIC_ID,
                 XmlConstants.SQL_MAP_SYSTEM_ID);
         document.setRootElement(getSqlMapElement(introspectedTable));
+        
+        afterGenerationHook(introspectedTable, document);
 
         FullyQualifiedTable table = introspectedTable.getTable();
         GeneratedXmlFile answer = new GeneratedXmlFile(document,
@@ -253,11 +255,21 @@
                 answer.addElement(element);
             }
         }
-
+        
         return answer;
     }
 
     /**
+     * Override this method to provide any extra Elements needed in the 
+     * generated XML.
+     * 
+     * @param generatedDocument the generated document
+     */
+    protected void afterGenerationHook(IntrospectedTable introspectedTable, Document generatedDocument)
{
+        return;
+    }
+
+    /**
      * This method should return an XmlElement which is the result map (without
      * any BLOBs if they exist in the table).
      * 
@@ -798,7 +810,7 @@
         answer.addAttribute(new Attribute("resultClass", identityColumnType)); //$NON-NLS-1$
         answer.addAttribute(new Attribute(
                 "keyProperty", columnDefinition.getJavaProperty())); //$NON-NLS-1$
-        answer.addElement(new TextElement(generatedKey.getSqlStatement()));
+        answer.addElement(new TextElement(generatedKey.getRuntimeSqlStatement()));
 
         return answer;
     }

Modified: ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/sqlmap/XmlConstants.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/sqlmap/XmlConstants.java?view=diff&rev=465374&r1=465373&r2=465374
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/sqlmap/XmlConstants.java
(original)
+++ ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/internal/sqlmap/XmlConstants.java
Wed Oct 18 14:11:40 2006
@@ -31,5 +31,7 @@
 
     public static final String SQL_MAP_PUBLIC_ID = "-//ibatis.apache.org//DTD SQL Map 2.0//EN";
//$NON-NLS-1$
     
+    public static final String ABATOR_CONFIG_SYSTEM_ID = "http://ibatis.apache.org/dtd/abator-config_1_0.dtd";
//$NON-NLS-1$
+    
     public static final String ABATOR_CONFIG_PUBLIC_ID = "-//Apache Software Foundation//DTD
Abator for iBATIS Configuration 1.0//EN"; //$NON-NLS-1$
 }



Mime
View raw message