ibatis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgbut...@apache.org
Subject svn commit: r703569 [1/6] - in /ibatis/trunk/java/tools/ibator/core: build/ devlib/ doc/ src/org/apache/ibatis/ibator/api/ src/org/apache/ibatis/ibator/config/ src/org/apache/ibatis/ibator/config/xml/ src/org/apache/ibatis/ibator/generator/ src/org/apa...
Date Fri, 10 Oct 2008 20:08:12 GMT
Author: jgbutler
Date: Fri Oct 10 13:08:10 2008
New Revision: 703569

URL: http://svn.apache.org/viewvc?rev=703569&view=rev
Log:
[ibator] initial checkin of ibator refactoring.  more to come.

Added:
    ibatis/trunk/java/tools/ibator/core/build/ant.bat
    ibatis/trunk/java/tools/ibator/core/devlib/ant-1.7.1.jar   (with props)
    ibatis/trunk/java/tools/ibator/core/devlib/ant-junit-1.7.1.jar   (with props)
    ibatis/trunk/java/tools/ibator/core/devlib/ant-launcher-1.7.1.jar   (with props)
    ibatis/trunk/java/tools/ibator/core/devlib/ant-nodeps-1.7.1.jar   (with props)
    ibatis/trunk/java/tools/ibator/core/devlib/ant-trax-1.7.1.jar   (with props)
    ibatis/trunk/java/tools/ibator/core/doc/MigrationNotes.txt
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/IntrospectedColumn.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/AbstractGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/AbstractGeneratorImpl.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/JavaGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/XmlGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/IntrospectedTableIbatis2Impl.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/XmlConstants.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/DAOGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/CountByExampleMethodGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/DAOElementGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/DAOElementGeneratorBaseImpl.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/DeleteByExampleMethodGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/DeleteByPrimaryKeyMethodGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/InsertMethodGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/InsertSelectiveMethodGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/SelectByExampleWithBLOBsMethodGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/SelectByExampleWithoutBLOBsMethodGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/SelectByPrimaryKeyMethodGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/UpdateByExampleParmsInnerclassGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/UpdateByExampleSelectiveMethodGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/UpdateByExampleWithBLOBsMethodGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/UpdateByExampleWithoutBLOBsMethodGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/UpdateByPrimaryKeySelectiveMethodGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/UpdateByPrimaryKeyWithBLOBsMethodGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/UpdateByPrimaryKeyWithoutBLOBsMethodGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/templates/
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/templates/AbstractDAOTemplate.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/templates/GenericCIDAOTemplate.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/templates/GenericSIDAOTemplate.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/templates/IbatisDAOTemplate.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/templates/SpringDAOTemplate.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/model/
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/model/BaseModelClassGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/model/BaseRecordGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/model/ExampleGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/model/PrimaryKeyGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/model/RecordWithBLOBsGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/model/RootClassInfo.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/SqlMapGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/CountByExampleElementGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/DeleteByExampleElementGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/DeleteByPrimaryKeyElementGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/ExampleWhereClauseElementGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/InsertElementGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/InsertSelectiveElementGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/ResultMapWithBLOBsElementGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/ResultMapWithoutBLOBsElementGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/SelectByExampleWithBLOBsElementGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/SelectByExampleWithoutBLOBsElementGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/SelectByPrimaryKeyElementGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/UpdateByExampleSelectiveElementGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/UpdateByExampleWithBLOBsElementGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/UpdateByExampleWithoutBLOBsElementGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/UpdateByPrimaryKeySelectiveElementGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/UpdateByPrimaryKeyWithBLOBsElementGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/UpdateByPrimaryKeyWithoutBLOBsElementGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/XmlElementGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/XmlElementGeneratorBaseImpl.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/types/JdbcTypeNameTranslator.java
Removed:
    ibatis/trunk/java/tools/ibator/core/devlib/ant.jar
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/DAOGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/JavaModelGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/SqlMapGenerator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/config/GeneratorSet.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/config/Java2GeneratorSet.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/config/Java5GeneratorSet.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/db/ColumnDefinition.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/db/ColumnDefinitions.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/db/IntrospectedTableDefaultImpl.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/java/
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/sqlmap/
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/types/ResolvedJavaType.java
Modified:
    ibatis/trunk/java/tools/ibator/core/build/build.bat
    ibatis/trunk/java/tools/ibator/core/build/build.xml
    ibatis/trunk/java/tools/ibator/core/build/clean.bat
    ibatis/trunk/java/tools/ibator/core/build/setupCmdLine.bat
    ibatis/trunk/java/tools/ibator/core/build/version.properties
    ibatis/trunk/java/tools/ibator/core/doc/ReleaseNotes.txt
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/FullyQualifiedTable.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/Ibator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/IbatorPlugin.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/IbatorPluginAdapter.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/IntrospectedTable.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/JavaTypeResolver.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/config/IbatorConfiguration.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/config/IbatorContext.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/config/JavaModelGeneratorConfiguration.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/config/SqlMapGeneratorConfiguration.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/config/xml/IbatorConfigurationParser.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/config/xml/ParserEntityResolver.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/config/xml/ibator-config_1_0.dtd
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/IbatorObjectFactory.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/IbatorPluginAggregator.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/db/DatabaseIntrospector.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/types/JavaTypeResolverDefaultImpl.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/util/messages/messages.properties
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/plugins/EqualsHashCodePlugin.java
    ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/plugins/SqlMapConfigPlugin.java
    ibatis/trunk/java/tools/ibator/core/testJava2/ibatortest/java2/ibatorConfig.xml
    ibatis/trunk/java/tools/ibator/core/testJava5/ibatortest/ibatorConfig.xml

Added: ibatis/trunk/java/tools/ibator/core/build/ant.bat
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/build/ant.bat?rev=703569&view=auto
==============================================================================
--- ibatis/trunk/java/tools/ibator/core/build/ant.bat (added)
+++ ibatis/trunk/java/tools/ibator/core/build/ant.bat Fri Oct 10 13:08:10 2008
@@ -0,0 +1,2 @@
+
+%JAVA_HOME%\bin\java -classpath ..\devlib\ant-launcher-1.7.1.jar org.apache.tools.ant.launch.Launcher -buildfile build.xml %1
\ No newline at end of file

Modified: ibatis/trunk/java/tools/ibator/core/build/build.bat
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/build/build.bat?rev=703569&r1=703568&r2=703569&view=diff
==============================================================================
--- ibatis/trunk/java/tools/ibator/core/build/build.bat (original)
+++ ibatis/trunk/java/tools/ibator/core/build/build.bat Fri Oct 10 13:08:10 2008
@@ -4,4 +4,4 @@
 
 call setupCmdLine.bat
 
-ant -lib ../devlib
+call ant.bat buildIbator

Modified: ibatis/trunk/java/tools/ibator/core/build/build.xml
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/build/build.xml?rev=703569&r1=703568&r2=703569&view=diff
==============================================================================
--- ibatis/trunk/java/tools/ibator/core/build/build.xml (original)
+++ ibatis/trunk/java/tools/ibator/core/build/build.xml Fri Oct 10 13:08:10 2008
@@ -95,8 +95,7 @@
     	deprecation="true" 
     	debug="true" 
     	source="1.5"
-    	target="1.5"
-        classpath="../devlib/ant.jar"/>
+    	target="1.5"/>
   </target>
 	  	
   <target name="build.ibator.jar" depends="build.compile">
@@ -151,8 +150,8 @@
     <javac destdir="${ibator.test.bin.dir}"
     	deprecation="true" 
     	debug="true"
-    	source="1.4"
-    	target="1.4">
+    	source="1.5"
+    	target="1.5">
       <src path="${basedir}/../test"/>
       <classpath>
         <pathelement location="${deploy.files}/ibator.jar"/>
@@ -184,7 +183,7 @@
     <mkdir dir="${reports.junit}"/>
   	<mkdir dir="${work.buildsupport}"/>
   	
-  	<!-- compile our build support classes -->
+    <!-- compile our build support classes -->
     <javac destdir="${work.buildsupport}"
     	deprecation="true" 
     	debug="true"
@@ -332,14 +331,14 @@
       </batchtest>
       <classpath>
       	<pathelement location="${generated.bin.dir.java2}"/>
-		<pathelement location="${basedir}/../devlib/ibatis-2.3.3.720.jar" />
-		<pathelement location="${basedir}/../devlib/hsqldb1.8.0.7.jar" />
-		<pathelement location="${basedir}/../devlib/commons-logging-1.1.1.jar" />
-		<pathelement location="${basedir}/../devlib/spring-beans-2.5.5.jar" />
-		<pathelement location="${basedir}/../devlib/spring-core-2.5.5.jar" />
-		<pathelement location="${basedir}/../devlib/spring-jdbc-2.5.5.jar" />
-		<pathelement location="${basedir}/../devlib/spring-orm-2.5.5.jar" />
-		<pathelement location="${basedir}/../devlib/spring-tx-2.5.5.jar" />
+        <pathelement location="${basedir}/../devlib/ibatis-2.3.3.720.jar" />
+        <pathelement location="${basedir}/../devlib/hsqldb1.8.0.7.jar" />
+        <pathelement location="${basedir}/../devlib/commons-logging-1.1.1.jar" />
+        <pathelement location="${basedir}/../devlib/spring-beans-2.5.5.jar" />
+        <pathelement location="${basedir}/../devlib/spring-core-2.5.5.jar" />
+        <pathelement location="${basedir}/../devlib/spring-jdbc-2.5.5.jar" />
+        <pathelement location="${basedir}/../devlib/spring-orm-2.5.5.jar" />
+        <pathelement location="${basedir}/../devlib/spring-tx-2.5.5.jar" />
       </classpath>
     </junit>
   </target>
@@ -354,14 +353,14 @@
       </batchtest>
       <classpath>
       	<pathelement location="${generated.bin.dir.java5}"/>
-		<pathelement location="${basedir}/../devlib/ibatis-2.3.3.720.jar" />
-		<pathelement location="${basedir}/../devlib/hsqldb1.8.0.7.jar" />
-		<pathelement location="${basedir}/../devlib/commons-logging-1.1.1.jar" />
-		<pathelement location="${basedir}/../devlib/spring-beans-2.5.5.jar" />
-		<pathelement location="${basedir}/../devlib/spring-core-2.5.5.jar" />
-		<pathelement location="${basedir}/../devlib/spring-jdbc-2.5.5.jar" />
-		<pathelement location="${basedir}/../devlib/spring-orm-2.5.5.jar" />
-		<pathelement location="${basedir}/../devlib/spring-tx-2.5.5.jar" />
+        <pathelement location="${basedir}/../devlib/ibatis-2.3.3.720.jar" />
+        <pathelement location="${basedir}/../devlib/hsqldb1.8.0.7.jar" />
+        <pathelement location="${basedir}/../devlib/commons-logging-1.1.1.jar" />
+        <pathelement location="${basedir}/../devlib/spring-beans-2.5.5.jar" />
+        <pathelement location="${basedir}/../devlib/spring-core-2.5.5.jar" />
+        <pathelement location="${basedir}/../devlib/spring-jdbc-2.5.5.jar" />
+        <pathelement location="${basedir}/../devlib/spring-orm-2.5.5.jar" />
+        <pathelement location="${basedir}/../devlib/spring-tx-2.5.5.jar" />
       </classpath>
     </junit>
   </target>
@@ -376,8 +375,8 @@
       </batchtest>
       <classpath>
       	<pathelement location="${generated.source.dir.java5}"/>
-		<pathelement location="${basedir}/../devlib/ibatis-2.3.1.710.jar" />
-		<pathelement location="${basedir}/../devlib/hsqldb1.8.0.7.jar" />
+        <pathelement location="${basedir}/../devlib/ibatis-2.3.1.710.jar" />
+        <pathelement location="${basedir}/../devlib/hsqldb1.8.0.7.jar" />
       </classpath>
     </junit>
 
@@ -390,8 +389,8 @@
       </batchtest>
       <classpath>
       	<pathelement location="${generated.source.dir.java2}"/>
-		<pathelement location="${basedir}/../devlib/ibatis-2.3.1.710.jar" />
-		<pathelement location="${basedir}/../devlib/hsqldb1.8.0.7.jar" />
+        <pathelement location="${basedir}/../devlib/ibatis-2.3.1.710.jar" />
+        <pathelement location="${basedir}/../devlib/hsqldb1.8.0.7.jar" />
       </classpath>
     </junit>
   </target>

Modified: ibatis/trunk/java/tools/ibator/core/build/clean.bat
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/build/clean.bat?rev=703569&r1=703568&r2=703569&view=diff
==============================================================================
--- ibatis/trunk/java/tools/ibator/core/build/clean.bat (original)
+++ ibatis/trunk/java/tools/ibator/core/build/clean.bat Fri Oct 10 13:08:10 2008
@@ -4,4 +4,4 @@
 
 call setupCmdLine.bat
 
-ant clean
+call ant.bat clean

Modified: ibatis/trunk/java/tools/ibator/core/build/setupCmdLine.bat
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/build/setupCmdLine.bat?rev=703569&r1=703568&r2=703569&view=diff
==============================================================================
--- ibatis/trunk/java/tools/ibator/core/build/setupCmdLine.bat (original)
+++ ibatis/trunk/java/tools/ibator/core/build/setupCmdLine.bat Fri Oct 10 13:08:10 2008
@@ -1,10 +1,5 @@
 rem Change the values in this file to the proper directories on your machine
 
-if defined ANT_HOME goto ant_home_defined
-set ANT_HOME=C:\JavaTools\apache-ant-1.6.5
-set PATH=%PATH%;%ANT_HOME%\bin;
-
-:ant_home_defined
 if defined JAVA_HOME goto java_home_defined
 set JAVA_HOME=C:\JavaTools\jdk1.5.0_11
 

Modified: ibatis/trunk/java/tools/ibator/core/build/version.properties
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/build/version.properties?rev=703569&r1=703568&r2=703569&view=diff
==============================================================================
--- ibatis/trunk/java/tools/ibator/core/build/version.properties (original)
+++ ibatis/trunk/java/tools/ibator/core/build/version.properties Fri Oct 10 13:08:10 2008
@@ -1,4 +1,4 @@
 #ibator build version info
-#Fri Aug 22 20:41:41 CDT 2008
+#Fri Oct 10 15:00:01 CDT 2008
 version=1.2.0
-buildNum=582
+buildNum=612

Added: ibatis/trunk/java/tools/ibator/core/devlib/ant-1.7.1.jar
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/devlib/ant-1.7.1.jar?rev=703569&view=auto
==============================================================================
Binary file - no diff available.

Propchange: ibatis/trunk/java/tools/ibator/core/devlib/ant-1.7.1.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: ibatis/trunk/java/tools/ibator/core/devlib/ant-junit-1.7.1.jar
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/devlib/ant-junit-1.7.1.jar?rev=703569&view=auto
==============================================================================
Binary file - no diff available.

Propchange: ibatis/trunk/java/tools/ibator/core/devlib/ant-junit-1.7.1.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: ibatis/trunk/java/tools/ibator/core/devlib/ant-launcher-1.7.1.jar
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/devlib/ant-launcher-1.7.1.jar?rev=703569&view=auto
==============================================================================
Binary file - no diff available.

Propchange: ibatis/trunk/java/tools/ibator/core/devlib/ant-launcher-1.7.1.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: ibatis/trunk/java/tools/ibator/core/devlib/ant-nodeps-1.7.1.jar
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/devlib/ant-nodeps-1.7.1.jar?rev=703569&view=auto
==============================================================================
Binary file - no diff available.

Propchange: ibatis/trunk/java/tools/ibator/core/devlib/ant-nodeps-1.7.1.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: ibatis/trunk/java/tools/ibator/core/devlib/ant-trax-1.7.1.jar
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/devlib/ant-trax-1.7.1.jar?rev=703569&view=auto
==============================================================================
Binary file - no diff available.

Propchange: ibatis/trunk/java/tools/ibator/core/devlib/ant-trax-1.7.1.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: ibatis/trunk/java/tools/ibator/core/doc/MigrationNotes.txt
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/doc/MigrationNotes.txt?rev=703569&view=auto
==============================================================================
--- ibatis/trunk/java/tools/ibator/core/doc/MigrationNotes.txt (added)
+++ ibatis/trunk/java/tools/ibator/core/doc/MigrationNotes.txt Fri Oct 10 13:08:10 2008
@@ -0,0 +1,10 @@
+1. Attribute "generatorSet" removed from <ibatorContext>,
+   new attribute "targetJRE" with similar meaning
+
+2. introspectedTableImplementation removed from <ibatorContext>
+
+3. type attribute removed from <javaModelGenerator>, <sqlMapGenerator>
+
+4. type attribute changed meaning on <daoGenerator>
+
+5. JavaTypeResolver interface changed

Modified: ibatis/trunk/java/tools/ibator/core/doc/ReleaseNotes.txt
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/doc/ReleaseNotes.txt?rev=703569&r1=703568&r2=703569&view=diff
==============================================================================
--- ibatis/trunk/java/tools/ibator/core/doc/ReleaseNotes.txt (original)
+++ ibatis/trunk/java/tools/ibator/core/doc/ReleaseNotes.txt Fri Oct 10 13:08:10 2008
@@ -5,6 +5,7 @@
 1. Fixed the JavaTypeResolver so that an unsupported data type can be
    overridden by configuration.
 2. Fixed IBATIS-523 - bug in EqualsHashCodePlugin
+3. Fixed IBATIS-542 - upgrade build to Ant 1.7.1
 
 Enhancements:
 1. Ibator now includes a plugin machanism that you can use to extend or
@@ -13,12 +14,14 @@
    ibator's built-in generators.  Plugins are now the preferred method for
    extending ibator and we recommend that you do not extend ibator's
    built in generators unless absolutely necessary.
-2. Added support for runtimeCatalog and runtimeSchema properties to the
+2. Major refactoring of ibator internals.  This has changed
+   the interface for overriding any of the supplied ibator generators.
+3. Added support for runtimeCatalog and runtimeSchema properties to the
    table configuration.  Thanks to Dan Turkenkopf for the idea and the
    patch!
-3. Added abiliy to configure an implementation of IntrospectedTable interface.
+4. Added ability to configure an implementation of IntrospectedTable interface.
    This to allow overriding of many default behaviors of ibator.
-4. New method - insertSelective
+5. New method - insertSelective
    
    
 Changes:

Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/FullyQualifiedTable.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/FullyQualifiedTable.java?rev=703569&r1=703568&r2=703569&view=diff
==============================================================================
--- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/FullyQualifiedTable.java (original)
+++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/FullyQualifiedTable.java Fri Oct 10 13:08:10 2008
@@ -65,7 +65,7 @@
      *  
      * @param introspectedTableName the actual table name as returned from DatabaseMetaData
      * 
-     * @param domainObjectName the configred domain object name for this table.
+     * @param domainObjectName the configured domain object name for this table.
      *  If nothing is configured, we'll build the domain object named based
      *  on the tableName or runtimeTableName.
      *  

Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/Ibator.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/Ibator.java?rev=703569&r1=703568&r2=703569&view=diff
==============================================================================
--- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/Ibator.java (original)
+++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/Ibator.java Fri Oct 10 13:08:10 2008
@@ -192,9 +192,10 @@
 
         int totalSteps = 0;
 
-        for (IbatorContext ibatorContext : contextsToRun) {
-            totalSteps += ibatorContext.getTotalSteps();
-        }
+        // TODO...
+//        for (IbatorContext ibatorContext : contextsToRun) {
+//            totalSteps += ibatorContext.getTotalSteps();
+//        }
         
         callback.setNumberOfSubTasks(totalSteps);
         

Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/IbatorPlugin.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/IbatorPlugin.java?rev=703569&r1=703568&r2=703569&view=diff
==============================================================================
--- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/IbatorPlugin.java (original)
+++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/IbatorPlugin.java Fri Oct 10 13:08:10 2008
@@ -25,7 +25,6 @@
 import org.apache.ibatis.ibator.api.dom.xml.Document;
 import org.apache.ibatis.ibator.api.dom.xml.XmlElement;
 import org.apache.ibatis.ibator.config.IbatorContext;
-import org.apache.ibatis.ibator.internal.db.ColumnDefinition;
 
 /**
  * This interface defines methods that will be called by ibator at different
@@ -656,7 +655,7 @@
      * @param topLevelClass the partially implemented model
      *   class.  You can add additional imported classes to the 
      *   implementation class if necessary.
-     * @param columnDefinition ibator's class containing information
+     * @param introspectedColumn ibator's class containing information
      *   about the column related to this field as introspected from
      *   the database
      * @param introspectedTable ibator's class containing information
@@ -666,7 +665,7 @@
      *   of multiple plugins, the first plugin returning false
      *   will disable the calling of further plugins.
      */
-    boolean modelFieldGenerated(Field field, TopLevelClass topLevelClass, ColumnDefinition columnDefinition, IntrospectedTable introspectedTable);
+    boolean modelFieldGenerated(Field field, TopLevelClass topLevelClass, IntrospectedColumn introspectedColumn, IntrospectedTable introspectedTable);
 
     /**
      * This method is called after the getter, or accessor, method
@@ -677,7 +676,7 @@
      * @param topLevelClass the partially implemented model
      *   class.  You can add additional imported classes to the 
      *   implementation class if necessary.
-     * @param columnDefinition ibator's class containing information
+     * @param introspectedColumn ibator's class containing information
      *   about the column related to this field as introspected from
      *   the database
      * @param introspectedTable ibator's class containing information
@@ -687,7 +686,7 @@
      *   of multiple plugins, the first plugin returning false
      *   will disable the calling of further plugins.
      */
-    boolean modelGetterMethodGenerated(Method method, TopLevelClass topLevelClass, ColumnDefinition columnDefinition, IntrospectedTable introspectedTable);
+    boolean modelGetterMethodGenerated(Method method, TopLevelClass topLevelClass, IntrospectedColumn introspectedColumn, IntrospectedTable introspectedTable);
 
     /**
      * This method is called after the setter, or mutator, method
@@ -698,7 +697,7 @@
      * @param topLevelClass the partially implemented model
      *   class.  You can add additional imported classes to the 
      *   implementation class if necessary.
-     * @param columnDefinition ibator's class containing information
+     * @param introspectedColumn ibator's class containing information
      *   about the column related to this field as introspected from
      *   the database
      * @param introspectedTable ibator's class containing information
@@ -708,7 +707,7 @@
      *   of multiple plugins, the first plugin returning false
      *   will disable the calling of further plugins.
      */
-    boolean modelSetterMethodGenerated(Method method, TopLevelClass topLevelClass, ColumnDefinition columnDefinition, IntrospectedTable introspectedTable);
+    boolean modelSetterMethodGenerated(Method method, TopLevelClass topLevelClass, IntrospectedColumn introspectedColumn, IntrospectedTable introspectedTable);
 
     /**
      * This method is called after the primary key class is generated by

Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/IbatorPluginAdapter.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/IbatorPluginAdapter.java?rev=703569&r1=703568&r2=703569&view=diff
==============================================================================
--- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/IbatorPluginAdapter.java (original)
+++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/IbatorPluginAdapter.java Fri Oct 10 13:08:10 2008
@@ -25,7 +25,6 @@
 import org.apache.ibatis.ibator.api.dom.xml.Document;
 import org.apache.ibatis.ibator.api.dom.xml.XmlElement;
 import org.apache.ibatis.ibator.config.IbatorContext;
-import org.apache.ibatis.ibator.internal.db.ColumnDefinition;
 
 /**
  * This class includes no-operation methods for almost every method in the
@@ -198,11 +197,11 @@
         return true;
     }
 
-    public boolean modelFieldGenerated(Field field, TopLevelClass topLevelClass, ColumnDefinition columnDefinition, IntrospectedTable introspectedTable) {
+    public boolean modelFieldGenerated(Field field, TopLevelClass topLevelClass, IntrospectedColumn introspectedColumn, IntrospectedTable introspectedTable) {
         return true;
     }
 
-    public boolean modelGetterMethodGenerated(Method method, TopLevelClass topLevelClass, ColumnDefinition columnDefinition, IntrospectedTable introspectedTable) {
+    public boolean modelGetterMethodGenerated(Method method, TopLevelClass topLevelClass, IntrospectedColumn introspectedColumn, IntrospectedTable introspectedTable) {
         return true;
     }
 
@@ -214,7 +213,7 @@
         return true;
     }
 
-    public boolean modelSetterMethodGenerated(Method method, TopLevelClass topLevelClass, ColumnDefinition columnDefinition, IntrospectedTable introspectedTable) {
+    public boolean modelSetterMethodGenerated(Method method, TopLevelClass topLevelClass, IntrospectedColumn introspectedColumn, IntrospectedTable introspectedTable) {
         return true;
     }
 

Added: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/IntrospectedColumn.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/IntrospectedColumn.java?rev=703569&view=auto
==============================================================================
--- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/IntrospectedColumn.java (added)
+++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/IntrospectedColumn.java Fri Oct 10 13:08:10 2008
@@ -0,0 +1,390 @@
+/*
+ * Copyright 2005 The Apache Software Foundation
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.ibatis.ibator.api;
+
+import java.sql.Types;
+import java.util.StringTokenizer;
+
+import org.apache.ibatis.ibator.api.dom.java.FullyQualifiedJavaType;
+import org.apache.ibatis.ibator.config.IbatorContext;
+import org.apache.ibatis.ibator.internal.types.JdbcTypeNameTranslator;
+import org.apache.ibatis.ibator.internal.util.StringUtility;
+
+/**
+ * This class holds information about an introspected column.  The
+ * class has utility methods useful for generating iBATIS objects.
+ * 
+ * @author Jeff Butler
+ */
+public class IntrospectedColumn {
+    private String actualColumnName;
+    
+    private int jdbcType;
+    
+    private String jdbcTypeName;
+
+    private boolean nullable;
+
+    private int length;
+
+    private int scale;
+
+    private boolean identity;
+
+    private String javaProperty;
+    
+    private FullyQualifiedJavaType fullyQualifiedJavaType;
+    
+    private String tableAlias;
+    
+    private String typeHandler;
+    
+    private IbatorContext ibatorContext;
+    
+    private boolean isColumnNameDelimited;
+
+    /**
+     * Constructs a Column definition.  This object holds all the 
+     * information about a column that is required to generate
+     * Java objects and SQL maps;
+     * 
+     * @param tableAlias The specified table alias, or null.  This
+     *   value is used to rename and alias column names for select statements
+     */
+    public IntrospectedColumn(String tableAlias, IbatorContext ibatorContext) {
+        super();
+        this.tableAlias = tableAlias;
+        this.ibatorContext = ibatorContext;
+    }
+
+    public int getJdbcType() {
+        return jdbcType;
+    }
+
+    public void setJdbcType(int jdbcType) {
+        this.jdbcType = jdbcType;
+    }
+
+    public int getLength() {
+        return length;
+    }
+
+    public void setLength(int length) {
+        this.length = length;
+    }
+
+    public boolean isNullable() {
+        return nullable;
+    }
+
+    public void setNullable(boolean nullable) {
+        this.nullable = nullable;
+    }
+
+    public int getScale() {
+        return scale;
+    }
+
+    public void setScale(int scale) {
+        this.scale = scale;
+    }
+
+	/*
+	 * This method is primarily used for debugging, so we don't externalize the strings
+	 */
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+
+        sb.append("Actual Column Name: "); //$NON-NLS-1$
+        sb.append(actualColumnName);
+        sb.append(", JDBC Type: "); //$NON-NLS-1$
+        sb.append(jdbcType);
+        sb.append(", Nullable: "); //$NON-NLS-1$
+        sb.append(nullable);
+        sb.append(", Length: "); //$NON-NLS-1$
+        sb.append(length);
+        sb.append(", Scale: "); //$NON-NLS-1$
+        sb.append(scale);
+        sb.append(", Identity: "); //$NON-NLS-1$
+        sb.append(identity);
+
+        return sb.toString();
+    }
+
+    public void setActualColumnName(String actualColumnName) {
+        this.actualColumnName = actualColumnName;
+        isColumnNameDelimited = StringUtility.stringContainsSpace(actualColumnName);
+    }
+
+    /**
+     * @return Returns the identity.
+     */
+    public boolean isIdentity() {
+        return identity;
+    }
+
+    /**
+     * @param identity
+     *            The identity to set.
+     */
+    public void setIdentity(boolean identity) {
+        this.identity = identity;
+    }
+
+    public boolean isBLOBColumn() {
+        String typeName = getJdbcTypeName();
+
+        return "BINARY".equals(typeName) || "BLOB".equals(typeName) //$NON-NLS-1$ //$NON-NLS-2$
+            || "CLOB".equals(typeName) || "LONGVARBINARY".equals(typeName) //$NON-NLS-1$ //$NON-NLS-2$
+            || "LONGVARCHAR".equals(typeName) || "VARBINARY".equals(typeName); //$NON-NLS-1$ //$NON-NLS-2$
+    }
+
+    public boolean isStringColumn() {
+        return fullyQualifiedJavaType.equals( 
+            FullyQualifiedJavaType.getStringInstance());
+    }
+    
+    public boolean isJdbcCharacterColumn() {
+        return jdbcType == Types.CHAR
+            || jdbcType == Types.CLOB
+            || jdbcType == Types.LONGVARCHAR
+            || jdbcType == Types.VARCHAR;
+    }
+
+    public String getJavaProperty() {
+        return getJavaProperty(null);
+    }
+
+    public String getJavaProperty(String prefix) {
+        if (prefix == null) {
+            return javaProperty;
+        }
+        
+        StringBuilder sb = new StringBuilder();
+        sb.append(prefix);
+        sb.append(javaProperty);
+        
+        return sb.toString();
+    }
+
+    public void setJavaProperty(String javaProperty) {
+        this.javaProperty = javaProperty;
+    }
+
+    /**
+     * The renamed column name for a select statement.  If there
+     * is a table alias, the value will be alias_columnName.  This is
+     * appropriate for use in a result map.
+     * 
+     * @return the renamed column name
+     */
+    public String getRenamedColumnNameForResultMap() {
+        if (StringUtility.stringHasValue(tableAlias)) {
+            StringBuilder sb = new StringBuilder();
+            
+            sb.append(tableAlias);
+            sb.append('_');
+            sb.append(actualColumnName);
+            return sb.toString();
+        } else {
+            return actualColumnName;
+        }
+    }
+
+    /**
+     * The phrase to use in a select list.  If there
+     * is a table alias, the value will be 
+     * "alias.columnName as alias_columnName"
+     * 
+     * @return the proper phrase
+     */
+    public String getSelectListPhrase() {
+        if (StringUtility.stringHasValue(tableAlias)) {
+            StringBuilder sb = new StringBuilder();
+            
+            sb.append(getAliasedEscapedColumnName());
+            sb.append(" as "); //$NON-NLS-1$
+            if (isColumnNameDelimited) {
+                sb.append(ibatorContext.getBeginningDelimiter());
+            }
+            sb.append(tableAlias);
+            sb.append('_');
+            sb.append(escapeStringForIbatis(actualColumnName));
+            if (isColumnNameDelimited) {
+                sb.append(ibatorContext.getEndingDelimiter());
+            }
+            return sb.toString();
+        } else {
+            return getEscapedColumnName();
+        }
+    }
+    
+    public boolean isJDBCDateColumn() {
+        return fullyQualifiedJavaType.equals(FullyQualifiedJavaType.getDateInstance())
+            && "DATE".equalsIgnoreCase(jdbcTypeName); //$NON-NLS-1$
+    }
+    
+    public boolean isJDBCTimeColumn() {
+        return fullyQualifiedJavaType.equals(FullyQualifiedJavaType.getDateInstance())
+            && "TIME".equalsIgnoreCase(jdbcTypeName); //$NON-NLS-1$
+    }
+    
+    public String getIbatisFormattedParameterClause() {
+        return getIbatisFormattedParameterClause(null);
+    }
+    
+    public String getIbatisFormattedParameterClause(String prefix) {
+        StringBuilder sb = new StringBuilder();
+        
+        sb.append('#');
+        sb.append(getJavaProperty(prefix));
+        
+        if (StringUtility.stringHasValue(typeHandler)) {
+            sb.append(",jdbcType="); //$NON-NLS-1$
+            sb.append(getJdbcTypeName());
+            sb.append(",handler="); //$NON-NLS-1$
+            sb.append(typeHandler);
+        } else {
+            sb.append(':');
+            sb.append(getJdbcTypeName());
+        }
+        
+        sb.append('#');
+        
+        return sb.toString();
+    }
+
+    public String getTypeHandler() {
+        return typeHandler;
+    }
+
+    public void setTypeHandler(String typeHandler) {
+        this.typeHandler = typeHandler;
+    }
+    
+    private String escapeStringForIbatis(String s) {
+        StringTokenizer st = new StringTokenizer(s, "$#", true); //$NON-NLS-1$
+        StringBuilder sb = new StringBuilder();
+        while (st.hasMoreTokens()) {
+            String token = st.nextToken();
+            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);
+            }
+        }
+        
+        return sb.toString();
+    }
+
+    public String getActualColumnName() {
+        return actualColumnName;
+    }
+
+    public String getEscapedColumnName() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(escapeStringForIbatis(actualColumnName));
+        
+        if (isColumnNameDelimited) {
+            sb.insert(0, ibatorContext.getBeginningDelimiter());
+            sb.append(ibatorContext.getEndingDelimiter());
+        }
+        
+        return sb.toString();
+    }
+
+    /**
+     * The aliased column name for a select statement generated by the example clauses.
+     * This is not appropriate for selects in SqlMaps because the column is
+     * not escaped for iBATIS.  If there
+     * is a table alias, the value will be alias.columnName.
+     * 
+     * This method is used in the Example classes and the returned value will be
+     * in a Java string.  So we need to escape double quotes if they are
+     * the delimiters.
+     * 
+     * @return the aliased column name
+     */
+    public String getAliasedActualColumnName() {
+        StringBuilder sb = new StringBuilder();
+        if (StringUtility.stringHasValue(tableAlias)) {
+            sb.append(tableAlias);
+            sb.append('.');
+        }
+
+        if (isColumnNameDelimited) {
+            sb.append(StringUtility.escapeStringForJava(ibatorContext.getBeginningDelimiter()));
+        }
+        
+        sb.append(actualColumnName);
+            
+        if (isColumnNameDelimited) {
+            sb.append(StringUtility.escapeStringForJava(ibatorContext.getEndingDelimiter()));
+        }
+        
+        return sb.toString();
+    }
+
+    /**
+     * Calculates the string to use in select phrases in SqlMaps.
+     * 
+     * @return the aliased escaped column name
+     */
+    public String getAliasedEscapedColumnName() {
+        if (StringUtility.stringHasValue(tableAlias)) {
+            StringBuilder sb = new StringBuilder();
+            
+            sb.append(tableAlias);
+            sb.append('.');
+            sb.append(getEscapedColumnName());
+            return sb.toString();
+        } else {
+            return getEscapedColumnName();
+        }
+    }
+
+    public void setColumnNameDelimited(boolean isColumnNameDelimited) {
+        this.isColumnNameDelimited = isColumnNameDelimited;
+    }
+
+    public boolean isColumnNameDelimited() {
+        return isColumnNameDelimited;
+    }
+
+    public String getJdbcTypeName() {
+        if (jdbcTypeName == null) {
+            jdbcTypeName = JdbcTypeNameTranslator.getJdbcTypeName(jdbcType);
+        }
+        
+        return jdbcTypeName;
+    }
+
+    public void setJdbcTypeName(String jdbcTypeName) {
+        this.jdbcTypeName = jdbcTypeName;
+    }
+
+    public FullyQualifiedJavaType getFullyQualifiedJavaType() {
+        return fullyQualifiedJavaType;
+    }
+
+    public void setFullyQualifiedJavaType(
+            FullyQualifiedJavaType fullyQualifiedJavaType) {
+        this.fullyQualifiedJavaType = fullyQualifiedJavaType;
+    }
+}

Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/IntrospectedTable.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/IntrospectedTable.java?rev=703569&r1=703568&r2=703569&view=diff
==============================================================================
--- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/IntrospectedTable.java (original)
+++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/IntrospectedTable.java Fri Oct 10 13:08:10 2008
@@ -16,15 +16,24 @@
 
 package org.apache.ibatis.ibator.api;
 
+import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
 
 import org.apache.ibatis.ibator.api.dom.java.FullyQualifiedJavaType;
+import org.apache.ibatis.ibator.config.DAOGeneratorConfiguration;
 import org.apache.ibatis.ibator.config.GeneratedKey;
 import org.apache.ibatis.ibator.config.IbatorContext;
+import org.apache.ibatis.ibator.config.JavaModelGeneratorConfiguration;
+import org.apache.ibatis.ibator.config.ModelType;
+import org.apache.ibatis.ibator.config.PropertyRegistry;
+import org.apache.ibatis.ibator.config.SqlMapGeneratorConfiguration;
 import org.apache.ibatis.ibator.config.TableConfiguration;
-import org.apache.ibatis.ibator.internal.db.ColumnDefinition;
-import org.apache.ibatis.ibator.internal.db.ColumnDefinitions;
+import org.apache.ibatis.ibator.internal.rules.ConditionalModelRules;
+import org.apache.ibatis.ibator.internal.rules.FlatModelRules;
+import org.apache.ibatis.ibator.internal.rules.HierarchicalModelRules;
 import org.apache.ibatis.ibator.internal.rules.IbatorRules;
+import org.apache.ibatis.ibator.internal.util.StringUtility;
 
 /**
  * Read only interface for dealing with introspected tables.
@@ -32,13 +41,86 @@
  * @author Jeff Butler
  *
  */
-public interface IntrospectedTable {
-    FullyQualifiedTable getFullyQualifiedTable();
-    String getSelectByExampleQueryId();
-    String getSelectByPrimaryKeyQueryId();
-    GeneratedKey getGeneratedKey();
-
-    ColumnDefinition getColumn(String columnName);
+public abstract class IntrospectedTable {
+    protected TableConfiguration tableConfiguration;
+    protected FullyQualifiedTable fullyQualifiedTable;
+    protected IbatorContext ibatorContext;
+    private IbatorRules rules;
+    private List<IntrospectedColumn> primaryKeyColumns;
+    private List<IntrospectedColumn> baseColumns;
+    private List<IntrospectedColumn> blobColumns;
+    private boolean hasJDBCDateColumns;
+    private boolean hasJDBCTimeColumns;
+    
+    public IntrospectedTable() {
+        super();
+        primaryKeyColumns = new ArrayList<IntrospectedColumn>();
+        baseColumns = new ArrayList<IntrospectedColumn>();
+        blobColumns = new ArrayList<IntrospectedColumn>();
+    }
+    
+    public FullyQualifiedTable getFullyQualifiedTable() {
+        return fullyQualifiedTable;
+    }
+    
+    public String getSelectByExampleQueryId() {
+        return tableConfiguration.getSelectByExampleQueryId();
+    }
+    
+    public String getSelectByPrimaryKeyQueryId() {
+        return tableConfiguration.getSelectByPrimaryKeyQueryId();
+    }
+
+    public GeneratedKey getGeneratedKey() {
+        return tableConfiguration.getGeneratedKey();
+    }
+
+    public IntrospectedColumn getColumn(String columnName) {
+        if (columnName == null) {
+            return null;
+        } else {
+            // search primary key columns
+            for (IntrospectedColumn introspectedColumn : primaryKeyColumns) {
+                if (introspectedColumn.isColumnNameDelimited()) {
+                    if (introspectedColumn.getActualColumnName().equals(columnName)) {
+                        return introspectedColumn;
+                    }
+                } else {
+                    if (introspectedColumn.getActualColumnName().equalsIgnoreCase(columnName)) {
+                        return introspectedColumn;
+                    }
+                }
+            }
+            
+            // search base columns
+            for (IntrospectedColumn introspectedColumn : baseColumns) {
+                if (introspectedColumn.isColumnNameDelimited()) {
+                    if (introspectedColumn.getActualColumnName().equals(columnName)) {
+                        return introspectedColumn;
+                    }
+                } else {
+                    if (introspectedColumn.getActualColumnName().equalsIgnoreCase(columnName)) {
+                        return introspectedColumn;
+                    }
+                }
+            }
+
+            // search blob columns
+            for (IntrospectedColumn introspectedColumn : blobColumns) {
+                if (introspectedColumn.isColumnNameDelimited()) {
+                    if (introspectedColumn.getActualColumnName().equals(columnName)) {
+                        return introspectedColumn;
+                    }
+                } else {
+                    if (introspectedColumn.getActualColumnName().equalsIgnoreCase(columnName)) {
+                        return introspectedColumn;
+                    }
+                }
+            }
+            
+            return null;
+        }
+    }
     
     /**
      * Returns true if any of the columns in the table are JDBC Dates
@@ -46,7 +128,9 @@
      * 
      * @return true if the table contains DATE columns
      */
-    boolean hasJDBCDateColumns();
+    public boolean hasJDBCDateColumns() {
+        return hasJDBCDateColumns;
+    }
 
     /**
      * Returns true if any of the columns in the table are JDBC Times
@@ -54,7 +138,9 @@
      * 
      * @return true if the table contains TIME columns
      */
-    boolean hasJDBCTimeColumns();
+    public boolean hasJDBCTimeColumns() {
+        return hasJDBCTimeColumns;
+    }
     
     /**
      * Returns the columns in the primary key.  If the
@@ -65,11 +151,17 @@
      * @return a List of ColumnDefinition objects for
      *   columns in the primary key
      */
-    List<ColumnDefinition> getPrimaryKeyColumns();
-    
-    boolean hasPrimaryKeyColumns();
-    
-    List<ColumnDefinition> getBaseColumns();
+    public List<IntrospectedColumn> getPrimaryKeyColumns() {
+        return primaryKeyColumns;
+    }
+    
+    public boolean hasPrimaryKeyColumns() {
+        return primaryKeyColumns.size() > 0;
+    }
+    
+    public List<IntrospectedColumn> getBaseColumns() {
+        return baseColumns;
+    }
     
     /**
      * Returns all columns in the table (for use by the select by
@@ -78,32 +170,84 @@
      * @return a List of ColumnDefinition objects for
      *   all columns in the table
      */
-    List<ColumnDefinition> getAllColumns();
+    public List<IntrospectedColumn> getAllColumns() {
+        List<IntrospectedColumn> answer = new ArrayList<IntrospectedColumn>();
+        answer.addAll(primaryKeyColumns);
+        answer.addAll(baseColumns);
+        answer.addAll(blobColumns);
+        
+        return answer;
+    }
     
     /**
-     * Returns all columns axcept BLOBs (for use by the select by
+     * Returns all columns except BLOBs (for use by the select by
      * example without BLOBs method)
      * 
      * @return a List of ColumnDefinition objects for
      *   columns in the table that are non BLOBs
      */
-    List<ColumnDefinition> getNonBLOBColumns();
-    
-    int getNonBLOBColumnCount();
-    
-    List<ColumnDefinition> getNonPrimaryKeyColumns();
-    
-    List<ColumnDefinition> getBLOBColumns();
-    
-    boolean hasBLOBColumns();
-    
-    boolean hasBaseColumns();
-    
-    IbatorRules getRules();
-    
-    String getTableConfigurationProperty(String property);
+    public List<IntrospectedColumn> getNonBLOBColumns() {
+        List<IntrospectedColumn> answer = new ArrayList<IntrospectedColumn>();
+        answer.addAll(primaryKeyColumns);
+        answer.addAll(baseColumns);
+        
+        return answer;
+    }
+    
+    public int getNonBLOBColumnCount() {
+        return primaryKeyColumns.size()
+            + baseColumns.size();
+    }
+    
+    public List<IntrospectedColumn> getNonPrimaryKeyColumns() {
+        List<IntrospectedColumn> answer = new ArrayList<IntrospectedColumn>();
+        answer.addAll(baseColumns);
+        answer.addAll(blobColumns);
+        
+        return answer;
+    }
+    
+    public List<IntrospectedColumn> getBLOBColumns() {
+        return blobColumns;
+    }
+    
+    public boolean hasBLOBColumns() {
+        return blobColumns.size() > 0;
+    }
+    
+    public boolean hasBaseColumns() {
+        return baseColumns.size() > 0;
+    }
+    
+    public IbatorRules getRules() {
+        if (rules == null) {
+            if (tableConfiguration.getModelType() == ModelType.HIERARCHICAL) {
+                rules = new HierarchicalModelRules(tableConfiguration, this);
+            } else if (tableConfiguration.getModelType() == ModelType.FLAT) {
+                rules = new FlatModelRules(tableConfiguration, this);
+            } else {
+                rules = new ConditionalModelRules(tableConfiguration, this);
+            }
+        }
+        
+        return rules;
+    }
+    
+    public String getTableConfigurationProperty(String property) {
+        return tableConfiguration.getProperty(property);
+    }
+
+    public FullyQualifiedJavaType getPrimaryKeyType() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getJavaModelPackage());
+        sb.append('.');
+        sb.append(fullyQualifiedTable.getDomainObjectName());
+        sb.append("Key"); //$NON-NLS-1$
 
-    FullyQualifiedJavaType getPrimaryKeyType();
+        FullyQualifiedJavaType fqjt = new FullyQualifiedJavaType(sb.toString());
+
+        return fqjt;
+    }
 
     /**
      * 
@@ -111,38 +255,231 @@
      *  key and non-BLOB fields).  Note that
      *  the value will be calculated regardless of whether the table has these columns or not.
      */
-    FullyQualifiedJavaType getBaseRecordType();
+    public FullyQualifiedJavaType getBaseRecordType() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getJavaModelPackage());
+        sb.append('.');
+        sb.append(fullyQualifiedTable.getDomainObjectName());
+
+        FullyQualifiedJavaType fqjt = new FullyQualifiedJavaType(sb.toString());
+
+        return fqjt;
+    }
 
     /**
      * 
      * @return the type for the example class.
      */
-    FullyQualifiedJavaType getExampleType();
+    public FullyQualifiedJavaType getExampleType() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getJavaModelPackage());
+        sb.append('.');
+        sb.append(fullyQualifiedTable.getDomainObjectName());
+        sb.append("Example"); //$NON-NLS-1$
+
+        FullyQualifiedJavaType fqjt = new FullyQualifiedJavaType(sb.toString());
+
+        return fqjt;
+    }
 
     /**
      * 
      * @return the type for the record with BLOBs class.  Note that
      *  the value will be calculated regardless of whether the table has BLOB columns or not.
      */
-    FullyQualifiedJavaType getRecordWithBLOBsType();
+    public FullyQualifiedJavaType getRecordWithBLOBsType() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getJavaModelPackage());
+        sb.append('.');
+        sb.append(fullyQualifiedTable.getDomainObjectName());
+        sb.append("WithBLOBs"); //$NON-NLS-1$
 
-    String getSqlMapFileName();
+        FullyQualifiedJavaType fqjt = new FullyQualifiedJavaType(sb.toString());
+
+        return fqjt;
+    }
+
+    /**
+     * Calculates an SQL Map file name for the table. Typically the name is
+     * "XXXX_SqlMap.xml" where XXXX is the fully qualified table name (delimited
+     * with underscores).
+     * 
+     * @return the name of the SqlMap file
+     */
+    public String getSqlMapFileName() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(fullyQualifiedTable.getSqlMapNamespace());
+        sb.append("_SqlMap.xml"); //$NON-NLS-1$
+
+        return sb.toString();
+    }
 
     /**
      * Calculates the package for the current table.
      * 
      * @return the package for the SqlMap for the current table
      */
-    String getSqlMapPackage();
+    public String getSqlMapPackage() {
+        SqlMapGeneratorConfiguration config = ibatorContext.getSqlMapGeneratorConfiguration();
+        
+        StringBuilder sb = new StringBuilder(config.getTargetPackage());
+        if (StringUtility.isTrue(config.getProperty(PropertyRegistry.ANY_ENABLE_SUB_PACKAGES))) {
+            sb.append(fullyQualifiedTable.getSubPackage());
+        }
+            
+        return sb.toString();
+    }
+    
+    public FullyQualifiedJavaType getDAOImplementationType() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getDAOPackage());
+        sb.append('.');
+        sb.append(fullyQualifiedTable.getDomainObjectName());
+        sb.append("DAOImpl"); //$NON-NLS-1$
+
+        FullyQualifiedJavaType fqjt = new FullyQualifiedJavaType(sb.toString());
+
+        return fqjt;
+    }
+
+    public FullyQualifiedJavaType getDAOInterfaceType() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getDAOPackage());
+        sb.append('.');
+        sb.append(fullyQualifiedTable.getDomainObjectName());
+        sb.append("DAO"); //$NON-NLS-1$
+
+        FullyQualifiedJavaType fqjt = new FullyQualifiedJavaType(sb.toString());
+
+        return fqjt;
+    }
+
+    public boolean hasAnyColumns() {
+        return primaryKeyColumns.size() > 0
+            || baseColumns.size() > 0
+            || blobColumns.size() > 0;
+    }
+    
+    protected String getDAOPackage() {
+        DAOGeneratorConfiguration config = ibatorContext.getDaoGeneratorConfiguration();
+        
+        StringBuilder sb = new StringBuilder();
+        sb.append(config.getTargetPackage());
+        if (StringUtility.isTrue(config.getProperty(PropertyRegistry.ANY_ENABLE_SUB_PACKAGES))) {
+            sb.append(fullyQualifiedTable.getSubPackage());
+        }
+        
+        return sb.toString();
+    }
+    
+    protected String getJavaModelPackage() {
+        JavaModelGeneratorConfiguration config = ibatorContext.getJavaModelGeneratorConfiguration();
+
+        StringBuilder sb = new StringBuilder();
+        sb.append(config.getTargetPackage());
+        if (StringUtility.isTrue(config.getProperty(PropertyRegistry.ANY_ENABLE_SUB_PACKAGES))) {
+            sb.append(fullyQualifiedTable.getSubPackage());
+        }
+        
+        return sb.toString();
+    }
+    
+    public void setTableConfiguration(TableConfiguration tableConfiguration) {
+        this.tableConfiguration = tableConfiguration;
+    }
+
+    public void setFullyQualifiedTable(FullyQualifiedTable fullyQualifiedTable) {
+        this.fullyQualifiedTable = fullyQualifiedTable;
+    }
+    
+    public void setIbatorContext(IbatorContext ibatorContext) {
+        this.ibatorContext = ibatorContext;
+    }
+
+    public void addColumn(IntrospectedColumn introspectedColumn) {
+        if (introspectedColumn.isBLOBColumn()) {
+            blobColumns.add(introspectedColumn);
+        } else {
+            baseColumns.add(introspectedColumn);
+        }
+        
+        if (introspectedColumn.isJDBCDateColumn()) {
+            hasJDBCDateColumns = true;
+        }
+        
+        if (introspectedColumn.isJDBCTimeColumn()) {
+            hasJDBCTimeColumns = true;
+        }
+    }
+    
+    public void addPrimaryKeyColumn(String columnName) {
+        boolean found = false;
+        // first search base columns
+        Iterator<IntrospectedColumn> iter = baseColumns.iterator();
+        while (iter.hasNext()) {
+            IntrospectedColumn introspectedColumn = iter.next();
+            if (introspectedColumn.getActualColumnName().equals(columnName)) {
+                primaryKeyColumns.add(introspectedColumn);
+                iter.remove();
+                found = true;
+                break;
+            }
+        }
+        
+        // search blob columns in the weird event that a blob is the primary key
+        if (!found) {
+            iter = blobColumns.iterator();
+            while (iter.hasNext()) {
+                IntrospectedColumn introspectedColumn = iter.next();
+                if (introspectedColumn.getActualColumnName().equals(columnName)) {
+                    primaryKeyColumns.add(introspectedColumn);
+                    iter.remove();
+                    found = true;
+                    break;
+                }
+            }
+        }
+    }
     
-    FullyQualifiedJavaType getDAOImplementationType();
-
-    FullyQualifiedJavaType getDAOInterfaceType();
+    /**
+     * This method can be used to initialize the generators before they
+     * will be called. 
+     * 
+     * This method is called after all the setX methods, but before
+     * getNumberOfSubtasks(), getGeneratedJavaFiles, and getGeneratedXmlFiles.
+     * 
+     * @param warnings
+     * @param progressCallback
+     */
+    public abstract void calculateGenerators(List<String> warnings, ProgressCallback progressCallback);
+    
+    /**
+     * This method should return the number of progress messages
+     * that will be generated by all the generators calculated for
+     * this table. 
+     * 
+     * This method is called after calculateGenerators().
+     * 
+     * @return the number of progress messages that will be generated
+     *   for this table
+     */
+    public abstract int getNumberOfSubtasks();
 
-    boolean hasAnyColumns();
+    /**
+     * This method should return a list of generated Java files related to
+     * this table.  This list could include various types of model classes,
+     * as well as DAO classes.
+     * 
+     * @return the list of generated Java files for this table
+     */
+    public abstract List<GeneratedJavaFile> getGeneratedJavaFiles();
     
-    void setTableConfiguration(TableConfiguration tableConfiguration);
-    void setColumnDefinitions(ColumnDefinitions columnDefinitions);
-    void setFullyQualifiedTable(FullyQualifiedTable fullyQualifiedTable);
-    void setIbatorContext(IbatorContext ibatorContext);
+    /**
+     * This method should return a list of generated XML files related to
+     * this table.  Most implementations will only return one file - 
+     * the generated SqlMap file.
+     * 
+     * @return the list of generated XML files for this table
+     */
+    public abstract List<GeneratedXmlFile> getGeneratedXmlFiles();
 }

Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/JavaTypeResolver.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/JavaTypeResolver.java?rev=703569&r1=703568&r2=703569&view=diff
==============================================================================
--- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/JavaTypeResolver.java (original)
+++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/JavaTypeResolver.java Fri Oct 10 13:08:10 2008
@@ -18,8 +18,8 @@
 import java.util.List;
 import java.util.Properties;
 
+import org.apache.ibatis.ibator.api.dom.java.FullyQualifiedJavaType;
 import org.apache.ibatis.ibator.config.IbatorContext;
-import org.apache.ibatis.ibator.internal.db.ColumnDefinition;
 
 /**
  * This interface describes methods that are required in any Java type
@@ -63,15 +63,13 @@
 	void setWarnings(List<String> warnings);
 
 	/**
-	 * Initializes the ResolvedJavaType property of the ColumnDescription based
-	 * on the jdbc type, length, and scale of the column.
+	 * Calculates and returns the Java type that should be associated
+	 * with this column based on the jdbc type, length, and scale of the column.
 	 * 
-	 * @param cd the JDBC type will be used first to resolve the Java type. If
-	 *            the type cannot be resolved from this value, then we will try
-	 *            from the type name (which may be the qualified UDT from the
-	 *            database)
-     * @return true if the type can be resolved, otherwize false.  If false,
-     *   the column will be set to Object type and a warning will be issued.
+	 * @param introspectedColumn the column whose Java type needs to be
+	 *        calculated
+     * @return true the calculated type, or null if an unsupported data type.  If null,
+     *   the column should be set to Object type and a warning will be issued.
 	 */
-	boolean initializeResolvedJavaType(ColumnDefinition cd);
+    FullyQualifiedJavaType calculateJavaType(IntrospectedColumn introspectedColumn);
 }

Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/config/IbatorConfiguration.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/config/IbatorConfiguration.java?rev=703569&r1=703568&r2=703569&view=diff
==============================================================================
--- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/config/IbatorConfiguration.java (original)
+++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/config/IbatorConfiguration.java Fri Oct 10 13:08:10 2008
@@ -22,7 +22,7 @@
 import org.apache.ibatis.ibator.api.dom.xml.Document;
 import org.apache.ibatis.ibator.api.dom.xml.XmlElement;
 import org.apache.ibatis.ibator.exception.InvalidConfigurationException;
-import org.apache.ibatis.ibator.internal.sqlmap.XmlConstants;
+import org.apache.ibatis.ibator.generator.ibatis2.XmlConstants;
 import org.apache.ibatis.ibator.internal.util.messages.Messages;
 
 /**



Mime
View raw message