From commitsmillerrobert@example.com Mon Jun 01 01:26:28 2009 Return-Path: <commitsmillerrobert@example.com> Delivered-To: millerrobert@example.com Received: (qmail 57427 invoked from network); 1 Jun 2009 01:26:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Jun 2009 01:26:27 -0000 Received: (qmail 98348 invoked by uid 500); 1 Jun 2009 01:26:40 -0000 Delivered-To: millerrobert@example.com Received: (qmail 98314 invoked by uid 500); 1 Jun 2009 01:26:40 -0000 Mailing-List: contact millerrobert@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:millerrobert@example.com> List-Unsubscribe: <mailto:millerrobert@example.com> List-Post: <mailto:millerrobert@example.com> List-Id: <commits.ibatis.apache.org> Reply-To: millerrobert@example.com Delivered-To: mailing list millerrobert@example.com Received: (qmail 98305 invoked by uid 99); 1 Jun 2009 01:26:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Jun 2009 01:26:40 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Jun 2009 01:26:38 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 2763E2388874; Mon, 1 Jun 2009 01:26:18 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r780545 - in /ibatis/trunk/java/ibatis-3: build.xml version.properties Date: Mon, 01 Jun 2009 01:26:17 -0000 To: millerrobert@example.com From: millerrobert@example.com X-Mailer: svnmailer-1.0.8 Message-Id: <millerrobert@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: cbegin Date: Mon Jun 1 01:26:17 2009 New Revision: 780545 URL: http://svn.apache.org/viewvc?rev=780545&view=rev Log: added migrations dist build Modified: ibatis/trunk/java/ibatis-3/build.xml ibatis/trunk/java/ibatis-3/version.properties Modified: ibatis/trunk/java/ibatis-3/build.xml URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/build.xml?rev=780545&r1=780544&r2=780545&view=diff ============================================================================== --- ibatis/trunk/java/ibatis-3/build.xml (original) +++ ibatis/trunk/java/ibatis-3/build.xml Mon Jun 1 01:26:17 2009 @@ -1,5 +1,30 @@ <project name="iBATIS-3" default="all" basedir="." > + <target name="build.migrations"> + <property file="version.properties"/> + <property name="build.root" value="./build/migrations"/> + <property name="migrations.exploded" value="${build.root}/exploded"/> + <property name="migrations.dist" value="${build.root}/dist"/> + <delete dir="${build.root}"/> + <mkdir dir="${build.root}"/> + <mkdir dir="${migrations.exploded}"/> + <mkdir dir="${migrations.exploded}/lib"/> + <mkdir dir="${migrations.dist}"/> + <copy todir="${migrations.exploded}" flatten="true"> + <fileset dir="./"> + <include name="ibatis-3-core/src/main/scripts/*"/> + </fileset> + </copy> + <copy todir="${migrations.exploded}/lib" flatten="true"> + <fileset dir="./"> + <include name="build/ibatis-3-core/exploded/*.jar"/> + </fileset> + </copy> + <jar jarfile="${migrations.dist}/migrations-${version}.${buildNum}.zip"> + <fileset dir="${migrations.exploded}"/> + </jar> + </target> + <target name="all"> <antcall target="_external_run"> <param name="target" value="all"/> Modified: ibatis/trunk/java/ibatis-3/version.properties URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/version.properties?rev=780545&r1=780544&r2=780545&view=diff ============================================================================== --- ibatis/trunk/java/ibatis-3/version.properties (original) +++ ibatis/trunk/java/ibatis-3/version.properties Mon Jun 1 01:26:17 2009 @@ -1,5 +1,5 @@ #Build version info -#Sun May 17 00:55:24 MDT 2009 +#Sun May 31 14:31:22 MDT 2009 version=3.0.0 -buildDate=2009/05/17 00\:55 -buildNum=158 +buildDate=2009/05/31 14\:31 +buildNum=162 From commitsmillerrobert@example.com Wed Jun 03 03:49:50 2009 Return-Path: <commitsmillerrobert@example.com> Delivered-To: millerrobert@example.com Received: (qmail 33554 invoked from network); 3 Jun 2009 03:49:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Jun 2009 03:49:50 -0000 Received: (qmail 22096 invoked by uid 500); 3 Jun 2009 03:50:02 -0000 Delivered-To: millerrobert@example.com Received: (qmail 22060 invoked by uid 500); 3 Jun 2009 03:50:02 -0000 Mailing-List: contact millerrobert@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:millerrobert@example.com> List-Unsubscribe: <mailto:millerrobert@example.com> List-Post: <mailto:millerrobert@example.com> List-Id: <commits.ibatis.apache.org> Reply-To: millerrobert@example.com Delivered-To: mailing list millerrobert@example.com Received: (qmail 22051 invoked by uid 99); 3 Jun 2009 03:50:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Jun 2009 03:50:02 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Jun 2009 03:49:54 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 938EB23888D0; Wed, 3 Jun 2009 03:49:32 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r781254 - in /ibatis/trunk/java/tools/ibator/core: build/ doc/ src/org/apache/ibatis/ibator/api/ src/org/apache/ibatis/ibator/api/dom/java/ src/org/apache/ibatis/ibator/config/ src/org/apache/ibatis/ibator/generator/ibatis2/dao/ src/org/apa... Date: Wed, 03 Jun 2009 03:49:30 -0000 To: millerrobert@example.com From: millerrobert@example.com X-Mailer: svnmailer-1.0.8 Message-Id: <millerrobert@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: jgbutler Date: Wed Jun 3 03:49:27 2009 New Revision: 781254 URL: http://svn.apache.org/viewvc?rev=781254&view=rev Log: [ibator] more refactorings for iBATIS3 Modified: 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/IntrospectedTable.java ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/dom/java/InnerClass.java ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/dom/java/Interface.java ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/dom/java/TopLevelClass.java ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/config/MergeConstants.java 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/CountByExampleMethodGenerator.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/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/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/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/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/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/internal/DefaultCommentGenerator.java ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/XmlFileMergerJaxp.java ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/rules/BaseIbatorRules.java ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/plugins/RenameExampleClassPlugin.java ibatis/trunk/java/tools/ibator/core/testJava5/ibatortest/execute/miscellaneous/MiscellaneousTests.java 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=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/build/version.properties (original) +++ ibatis/trunk/java/tools/ibator/core/build/version.properties Wed Jun 3 03:49:27 2009 @@ -1,4 +1,4 @@ #Ibator build version info -#Thu May 28 17:11:28 EDT 2009 +#Tue Jun 02 22:46:10 CDT 2009 version=1.2.2 -buildNum=737 +buildNum=739 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=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/doc/ReleaseNotes.txt (original) +++ ibatis/trunk/java/tools/ibator/core/doc/ReleaseNotes.txt Wed Jun 3 03:49:27 2009 @@ -28,6 +28,10 @@ 11. IBATIS-592 - Additional attributes for SqlMaps 12. Fixed addCriterionfor JDBC* methods so that they all do a null check 13. Fixed IbatorRunner so that configuration errors are shown (thanks to Karel Rank) +14. Added XML ids to changeable attributes on introspected table, also + change the XML merger so that the XML ids no longer need to contain + the prefix "ibatorgenerated_" +15. Many refactorings to make way for iBATIS3 ------------------------------------------------------------------------------- Version 1.2.1: 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=781254&r1=781253&r2=781254&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 Wed Jun 3 03:49:27 2009 @@ -22,12 +22,10 @@ import java.util.List; import java.util.Map; -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.MergeConstants; import org.apache.ibatis.ibator.config.ModelType; import org.apache.ibatis.ibator.config.PropertyRegistry; import org.apache.ibatis.ibator.config.SqlMapGeneratorConfiguration; @@ -99,7 +97,7 @@ * Internal attributes are used * to store commonly accessed items by all code generators */ - protected Map<IntrospectedTable.InternalAttribute, Object> internalAttributes; + protected Map<IntrospectedTable.InternalAttribute, String> internalAttributes; public IntrospectedTable() { super(); @@ -107,7 +105,7 @@ baseColumns = new ArrayList<IntrospectedColumn>(); blobColumns = new ArrayList<IntrospectedColumn>(); attributes = new HashMap<String, Object>(); - internalAttributes = new HashMap<IntrospectedTable.InternalAttribute, Object>(); + internalAttributes = new HashMap<IntrospectedTable.InternalAttribute, String>(); } public FullyQualifiedTable getFullyQualifiedTable() { @@ -314,8 +312,8 @@ return tableConfiguration.getProperty(property); } - public FullyQualifiedJavaType getPrimaryKeyType() { - return (FullyQualifiedJavaType) internalAttributes.get(InternalAttribute.ATTR_PRIMARY_KEY_TYPE); + public String getPrimaryKeyType() { + return internalAttributes.get(InternalAttribute.ATTR_PRIMARY_KEY_TYPE); } /** @@ -324,16 +322,16 @@ * key and non-BLOB fields). Note that * the value will be calculated regardless of whether the table has these columns or not. */ - public FullyQualifiedJavaType getBaseRecordType() { - return (FullyQualifiedJavaType) internalAttributes.get(InternalAttribute.ATTR_BASE_RECORD_TYPE); + public String getBaseRecordType() { + return internalAttributes.get(InternalAttribute.ATTR_BASE_RECORD_TYPE); } /** * * @return the type for the example class. */ - public FullyQualifiedJavaType getExampleType() { - return (FullyQualifiedJavaType) internalAttributes.get(InternalAttribute.ATTR_EXAMPLE_TYPE); + public String getExampleType() { + return internalAttributes.get(InternalAttribute.ATTR_EXAMPLE_TYPE); } /** @@ -341,8 +339,8 @@ * @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. */ - public FullyQualifiedJavaType getRecordWithBLOBsType() { - return (FullyQualifiedJavaType) internalAttributes.get(InternalAttribute.ATTR_RECORD_WITH_BLOBS_TYPE); + public String getRecordWithBLOBsType() { + return internalAttributes.get(InternalAttribute.ATTR_RECORD_WITH_BLOBS_TYPE); } /** @@ -353,11 +351,11 @@ * @return the name of the SqlMap file */ public String getSqlMapFileName() { - return (String) internalAttributes.get(InternalAttribute.ATTR_SQL_MAP_FILE_NAME); + return internalAttributes.get(InternalAttribute.ATTR_SQL_MAP_FILE_NAME); } public String getSqlMapNamespace() { - return (String) internalAttributes.get(InternalAttribute.ATTR_SQL_MAP_NAMESPACE); + return internalAttributes.get(InternalAttribute.ATTR_SQL_MAP_NAMESPACE); } /** @@ -366,15 +364,15 @@ * @return the package for the SqlMap for the current table */ public String getSqlMapPackage() { - return (String) internalAttributes.get(InternalAttribute.ATTR_SQL_MAP_PACKAGE); + return internalAttributes.get(InternalAttribute.ATTR_SQL_MAP_PACKAGE); } - public FullyQualifiedJavaType getDAOImplementationType() { - return (FullyQualifiedJavaType) internalAttributes.get(InternalAttribute.ATTR_DAO_IMPLEMENTATION_TYPE); + public String getDAOImplementationType() { + return internalAttributes.get(InternalAttribute.ATTR_DAO_IMPLEMENTATION_TYPE); } - public FullyQualifiedJavaType getDAOInterfaceType() { - return (FullyQualifiedJavaType) internalAttributes.get(InternalAttribute.ATTR_DAO_INTERFACE_TYPE); + public String getDAOInterfaceType() { + return internalAttributes.get(InternalAttribute.ATTR_DAO_INTERFACE_TYPE); } public boolean hasAnyColumns() { @@ -472,101 +470,25 @@ setSqlMapFullyQualifiedRuntimeTableName(calculateSqlMapFullyQualifiedRuntimeTableName()); setSqlMapAliasedFullyQualifiedRuntimeTableName(calculateSqlMapAliasedFullyQualifiedRuntimeTableName()); - StringBuilder sb = new StringBuilder(); - - sb.append(MergeConstants.NEW_XML_ELEMENT_PREFIX); - sb.append("countByExample"); //$NON-NLS-1$ - setCountByExampleStatementId(sb.toString()); - - sb.setLength(0); - sb.append(MergeConstants.NEW_XML_ELEMENT_PREFIX); - sb.append("deleteByExample"); //$NON-NLS-1$ - setDeleteByExampleStatementId(sb.toString()); - - sb.setLength(0); - sb.append(MergeConstants.NEW_XML_ELEMENT_PREFIX); - sb.append("deleteByPrimaryKey"); //$NON-NLS-1$ - setDeleteByPrimaryKeyStatementId(sb.toString()); - - sb.setLength(0); - sb.append(MergeConstants.NEW_XML_ELEMENT_PREFIX); - sb.append("insert"); //$NON-NLS-1$ - setInsertStatementId(sb.toString()); - - sb.setLength(0); - sb.append(MergeConstants.NEW_XML_ELEMENT_PREFIX); - sb.append("insertSelective"); //$NON-NLS-1$ - setInsertSelectiveStatementId(sb.toString()); - - sb.setLength(0); - sb.append(MergeConstants.NEW_XML_ELEMENT_PREFIX); - sb.append("selectByExample"); //$NON-NLS-1$ - setSelectByExampleStatementId(sb.toString()); - - sb.setLength(0); - sb.append(MergeConstants.NEW_XML_ELEMENT_PREFIX); - sb.append("selectByExampleWithBLOBs"); //$NON-NLS-1$ - setSelectByExampleWithBLOBsStatementId(sb.toString()); - - sb.setLength(0); - sb.append(MergeConstants.NEW_XML_ELEMENT_PREFIX); - sb.append("selectByPrimaryKey"); //$NON-NLS-1$ - setSelectByPrimaryKeyStatementId(sb.toString()); - - sb.setLength(0); - sb.append(MergeConstants.NEW_XML_ELEMENT_PREFIX); - sb.append("updateByExample"); //$NON-NLS-1$ - setUpdateByExampleStatementId(sb.toString()); - - sb.setLength(0); - sb.append(MergeConstants.NEW_XML_ELEMENT_PREFIX); - sb.append("updateByExampleSelective"); //$NON-NLS-1$ - setUpdateByExampleSelectiveStatementId(sb.toString()); - - sb.setLength(0); - sb.append(MergeConstants.NEW_XML_ELEMENT_PREFIX); - sb.append("updateByExampleWithBLOBs"); //$NON-NLS-1$ - setUpdateByExampleWithBLOBsStatementId(sb.toString()); - - sb.setLength(0); - sb.append(MergeConstants.NEW_XML_ELEMENT_PREFIX); - sb.append("updateByPrimaryKey"); //$NON-NLS-1$ - setUpdateByPrimaryKeyStatementId(sb.toString()); - - sb.setLength(0); - sb.append(MergeConstants.NEW_XML_ELEMENT_PREFIX); - sb.append("updateByPrimaryKeySelective"); //$NON-NLS-1$ - setUpdateByPrimaryKeySelectiveStatementId(sb.toString()); - - sb.setLength(0); - sb.append(MergeConstants.NEW_XML_ELEMENT_PREFIX); - sb.append("updateByPrimaryKeyWithBLOBs"); //$NON-NLS-1$ - setUpdateByPrimaryKeyWithBLOBsStatementId(sb.toString()); - - sb.setLength(0); - sb.append(MergeConstants.NEW_XML_ELEMENT_PREFIX); - sb.append("BaseResultMap"); //$NON-NLS-1$ - setBaseResultMapId(sb.toString()); - - sb.setLength(0); - sb.append(MergeConstants.NEW_XML_ELEMENT_PREFIX); - sb.append("ResultMapWithBLOBs"); //$NON-NLS-1$ - setResultMapWithBLOBsId(sb.toString()); - - sb.setLength(0); - sb.append(MergeConstants.NEW_XML_ELEMENT_PREFIX); - sb.append("Example_Where_Clause"); //$NON-NLS-1$ - setExampleWhereClauseId(sb.toString()); - - sb.setLength(0); - sb.append(MergeConstants.NEW_XML_ELEMENT_PREFIX); - sb.append("Base_Column_List"); //$NON-NLS-1$ - setBaseColumnListId(sb.toString()); - - sb.setLength(0); - sb.append(MergeConstants.NEW_XML_ELEMENT_PREFIX); - sb.append("Blob_Column_List"); //$NON-NLS-1$ - setBlobColumnListId(sb.toString()); + setCountByExampleStatementId("countByExample"); //$NON-NLS-1$ + setDeleteByExampleStatementId("deleteByExample"); //$NON-NLS-1$ + setDeleteByPrimaryKeyStatementId("deleteByPrimaryKey"); //$NON-NLS-1$ + setInsertStatementId("insert"); //$NON-NLS-1$ + setInsertSelectiveStatementId("insertSelective"); //$NON-NLS-1$ + setSelectByExampleStatementId("selectByExample"); //$NON-NLS-1$ + setSelectByExampleWithBLOBsStatementId("selectByExampleWithBLOBs"); //$NON-NLS-1$ + setSelectByPrimaryKeyStatementId("selectByPrimaryKey"); //$NON-NLS-1$ + setUpdateByExampleStatementId("updateByExample"); //$NON-NLS-1$ + setUpdateByExampleSelectiveStatementId("updateByExampleSelective"); //$NON-NLS-1$ + setUpdateByExampleWithBLOBsStatementId("updateByExampleWithBLOBs"); //$NON-NLS-1$ + setUpdateByPrimaryKeyStatementId("updateByPrimaryKey"); //$NON-NLS-1$ + setUpdateByPrimaryKeySelectiveStatementId("updateByPrimaryKeySelective"); //$NON-NLS-1$ + setUpdateByPrimaryKeyWithBLOBsStatementId("updateByPrimaryKeyWithBLOBs"); //$NON-NLS-1$ + setBaseResultMapId("BaseResultMap"); //$NON-NLS-1$ + setResultMapWithBLOBsId("ResultMapWithBLOBs"); //$NON-NLS-1$ + setExampleWhereClauseId("Example_Where_Clause"); //$NON-NLS-1$ + setBaseColumnListId("Base_Column_List"); //$NON-NLS-1$ + setBlobColumnListId("Blob_Column_List"); //$NON-NLS-1$ } public void setBlobColumnListId(String s) { @@ -625,7 +547,7 @@ internalAttributes.put(InternalAttribute.ATTR_SELECT_BY_EXAMPLE_STATEMENT_ID, s); } - private void setInsertSelectiveStatementId(String s) { + public void setInsertSelectiveStatementId(String s) { internalAttributes.put(InternalAttribute.ATTR_INSERT_SELECTIVE_STATEMENT_ID, s); } @@ -646,79 +568,79 @@ } public String getBlobColumnListId() { - return (String) internalAttributes.get(InternalAttribute.ATTR_BLOB_COLUMN_LIST_ID); + return internalAttributes.get(InternalAttribute.ATTR_BLOB_COLUMN_LIST_ID); } public String getBaseColumnListId() { - return (String) internalAttributes.get(InternalAttribute.ATTR_BASE_COLUMN_LIST_ID); + return internalAttributes.get(InternalAttribute.ATTR_BASE_COLUMN_LIST_ID); } public String getExampleWhereClauseId() { - return (String) internalAttributes.get(InternalAttribute.ATTR_EXAMPLE_WHERE_CLAUSE_ID); + return internalAttributes.get(InternalAttribute.ATTR_EXAMPLE_WHERE_CLAUSE_ID); } public String getResultMapWithBLOBsId() { - return (String) internalAttributes.get(InternalAttribute.ATTR_RESULT_MAP_WITH_BLOBS_ID); + return internalAttributes.get(InternalAttribute.ATTR_RESULT_MAP_WITH_BLOBS_ID); } public String getBaseResultMapId() { - return (String) internalAttributes.get(InternalAttribute.ATTR_BASE_RESULT_MAP_ID); + return internalAttributes.get(InternalAttribute.ATTR_BASE_RESULT_MAP_ID); } public String getUpdateByPrimaryKeyWithBLOBsStatementId() { - return (String) internalAttributes.get(InternalAttribute.ATTR_UPDATE_BY_PRIMARY_KEY_WITH_BLOBS_STATEMENT_ID); + return internalAttributes.get(InternalAttribute.ATTR_UPDATE_BY_PRIMARY_KEY_WITH_BLOBS_STATEMENT_ID); } public String getUpdateByPrimaryKeySelectiveStatementId() { - return (String) internalAttributes.get(InternalAttribute.ATTR_UPDATE_BY_PRIMARY_KEY_SELECTIVE_STATEMENT_ID); + return internalAttributes.get(InternalAttribute.ATTR_UPDATE_BY_PRIMARY_KEY_SELECTIVE_STATEMENT_ID); } public String getUpdateByPrimaryKeyStatementId() { - return (String) internalAttributes.get(InternalAttribute.ATTR_UPDATE_BY_PRIMARY_KEY_STATEMENT_ID); + return internalAttributes.get(InternalAttribute.ATTR_UPDATE_BY_PRIMARY_KEY_STATEMENT_ID); } public String getUpdateByExampleWithBLOBsStatementId() { - return (String) internalAttributes.get(InternalAttribute.ATTR_UPDATE_BY_EXAMPLE_WITH_BLOBS_STATEMENT_ID); + return internalAttributes.get(InternalAttribute.ATTR_UPDATE_BY_EXAMPLE_WITH_BLOBS_STATEMENT_ID); } public String getUpdateByExampleSelectiveStatementId() { - return (String) internalAttributes.get(InternalAttribute.ATTR_UPDATE_BY_EXAMPLE_SELECTIVE_STATEMENT_ID); + return internalAttributes.get(InternalAttribute.ATTR_UPDATE_BY_EXAMPLE_SELECTIVE_STATEMENT_ID); } public String getUpdateByExampleStatementId() { - return (String) internalAttributes.get(InternalAttribute.ATTR_UPDATE_BY_EXAMPLE_STATEMENT_ID); + return internalAttributes.get(InternalAttribute.ATTR_UPDATE_BY_EXAMPLE_STATEMENT_ID); } public String getSelectByPrimaryKeyStatementId() { - return (String) internalAttributes.get(InternalAttribute.ATTR_SELECT_BY_PRIMARY_KEY_STATEMENT_ID); + return internalAttributes.get(InternalAttribute.ATTR_SELECT_BY_PRIMARY_KEY_STATEMENT_ID); } public String getSelectByExampleWithBLOBsStatementId() { - return (String) internalAttributes.get(InternalAttribute.ATTR_SELECT_BY_EXAMPLE_WITH_BLOBS_STATEMENT_ID); + return internalAttributes.get(InternalAttribute.ATTR_SELECT_BY_EXAMPLE_WITH_BLOBS_STATEMENT_ID); } public String getSelectByExampleStatementId() { - return (String) internalAttributes.get(InternalAttribute.ATTR_SELECT_BY_EXAMPLE_STATEMENT_ID); + return internalAttributes.get(InternalAttribute.ATTR_SELECT_BY_EXAMPLE_STATEMENT_ID); } public String getInsertSelectiveStatementId() { - return (String) internalAttributes.get(InternalAttribute.ATTR_INSERT_SELECTIVE_STATEMENT_ID); + return internalAttributes.get(InternalAttribute.ATTR_INSERT_SELECTIVE_STATEMENT_ID); } public String getInsertStatementId() { - return (String) internalAttributes.get(InternalAttribute.ATTR_INSERT_STATEMENT_ID); + return internalAttributes.get(InternalAttribute.ATTR_INSERT_STATEMENT_ID); } public String getDeleteByPrimaryKeyStatementId() { - return (String) internalAttributes.get(InternalAttribute.ATTR_DELETE_BY_PRIMARY_KEY_STATEMENT_ID); + return internalAttributes.get(InternalAttribute.ATTR_DELETE_BY_PRIMARY_KEY_STATEMENT_ID); } public String getDeleteByExampleStatementId() { - return (String) internalAttributes.get(InternalAttribute.ATTR_DELETE_BY_EXAMPLE_STATEMENT_ID); + return internalAttributes.get(InternalAttribute.ATTR_DELETE_BY_EXAMPLE_STATEMENT_ID); } public String getCountByExampleStatementId() { - return (String) internalAttributes.get(InternalAttribute.ATTR_COUNT_BY_EXAMPLE_STATEMENT_ID); + return internalAttributes.get(InternalAttribute.ATTR_COUNT_BY_EXAMPLE_STATEMENT_ID); } protected String calculateDAOImplementationPackage() { @@ -765,16 +687,14 @@ sb.append('.'); sb.append(fullyQualifiedTable.getDomainObjectName()); sb.append("DAOImpl"); //$NON-NLS-1$ - FullyQualifiedJavaType fqjt = new FullyQualifiedJavaType(sb.toString()); - setDAOImplementationType(fqjt); + setDAOImplementationType(sb.toString()); sb.setLength(0); sb.append(calculateDAOInterfacePackage()); sb.append('.'); sb.append(fullyQualifiedTable.getDomainObjectName()); sb.append("DAO"); //$NON-NLS-1$ - fqjt = new FullyQualifiedJavaType(sb.toString()); - setDAOInterfaceType(fqjt); + setDAOInterfaceType(sb.toString()); } protected String calculateJavaModelPackage() { @@ -797,31 +717,27 @@ sb.append('.'); sb.append(fullyQualifiedTable.getDomainObjectName()); sb.append("Key"); //$NON-NLS-1$ - FullyQualifiedJavaType fqjt = new FullyQualifiedJavaType(sb.toString()); - setPrimaryKeyType(fqjt); + setPrimaryKeyType(sb.toString()); sb.setLength(0); sb.append(pakkage); sb.append('.'); sb.append(fullyQualifiedTable.getDomainObjectName()); - fqjt = new FullyQualifiedJavaType(sb.toString()); - setBaseRecordType(fqjt); + setBaseRecordType(sb.toString()); sb.setLength(0); sb.append(pakkage); sb.append('.'); sb.append(fullyQualifiedTable.getDomainObjectName()); sb.append("WithBLOBs"); //$NON-NLS-1$ - fqjt = new FullyQualifiedJavaType(sb.toString()); - setRecordWithBLOBsType(fqjt); + setRecordWithBLOBsType(sb.toString()); sb.setLength(0); sb.append(pakkage); sb.append('.'); sb.append(fullyQualifiedTable.getDomainObjectName()); sb.append("Example"); //$NON-NLS-1$ - fqjt = new FullyQualifiedJavaType(sb.toString()); - setExampleType(fqjt); + setExampleType(sb.toString()); } protected String calculateSqlMapPackage() { @@ -854,11 +770,11 @@ } public String getFullyQualifiedTableNameAtRuntime() { - return (String) internalAttributes.get(InternalAttribute.ATTR_SQL_MAP_FULLY_QUALIFIED_TABLE_NAME_AT_RUNTIME); + return internalAttributes.get(InternalAttribute.ATTR_SQL_MAP_FULLY_QUALIFIED_TABLE_NAME_AT_RUNTIME); } public String getAliasedFullyQualifiedTableNameAtRuntime() { - return (String) internalAttributes.get(InternalAttribute.ATTR_SQL_MAP_ALIASED_FULLY_QUALIFIED_TABLE_NAME_AT_RUNTIME); + return internalAttributes.get(InternalAttribute.ATTR_SQL_MAP_ALIASED_FULLY_QUALIFIED_TABLE_NAME_AT_RUNTIME); } @@ -922,27 +838,27 @@ return tableConfiguration; } - public void setDAOImplementationType(FullyQualifiedJavaType DAOImplementationType) { + public void setDAOImplementationType(String DAOImplementationType) { internalAttributes.put(InternalAttribute.ATTR_DAO_IMPLEMENTATION_TYPE, DAOImplementationType); } - public void setDAOInterfaceType(FullyQualifiedJavaType DAOInterfaceType) { + public void setDAOInterfaceType(String DAOInterfaceType) { internalAttributes.put(InternalAttribute.ATTR_DAO_INTERFACE_TYPE, DAOInterfaceType); } - public void setPrimaryKeyType(FullyQualifiedJavaType primaryKeyType) { + public void setPrimaryKeyType(String primaryKeyType) { internalAttributes.put(InternalAttribute.ATTR_PRIMARY_KEY_TYPE, primaryKeyType); } - public void setBaseRecordType(FullyQualifiedJavaType baseRecordType) { + public void setBaseRecordType(String baseRecordType) { internalAttributes.put(InternalAttribute.ATTR_BASE_RECORD_TYPE, baseRecordType); } - public void setRecordWithBLOBsType(FullyQualifiedJavaType recordWithBLOBsType) { + public void setRecordWithBLOBsType(String recordWithBLOBsType) { internalAttributes.put(InternalAttribute.ATTR_RECORD_WITH_BLOBS_TYPE, recordWithBLOBsType); } - public void setExampleType(FullyQualifiedJavaType exampleType) { + public void setExampleType(String exampleType) { internalAttributes.put(InternalAttribute.ATTR_EXAMPLE_TYPE, exampleType); } Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/dom/java/InnerClass.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/dom/java/InnerClass.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/dom/java/InnerClass.java (original) +++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/dom/java/InnerClass.java Wed Jun 3 03:49:27 2009 @@ -56,6 +56,10 @@ superInterfaceTypes = new HashSet<FullyQualifiedJavaType>(); methods = new ArrayList<Method>(); } + + public InnerClass(String typeName) { + this(new FullyQualifiedJavaType(typeName)); + } /** * @return Returns the fields. @@ -82,6 +86,10 @@ public void setSuperClass(FullyQualifiedJavaType superClass) { this.superClass = superClass; } + + public void setSuperClass(String superClassType) { + this.superClass = new FullyQualifiedJavaType(superClassType); + } /** * @return Returns the innerClasses. */ Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/dom/java/Interface.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/dom/java/Interface.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/dom/java/Interface.java (original) +++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/dom/java/Interface.java Wed Jun 3 03:49:27 2009 @@ -52,6 +52,10 @@ fileCommentLines = new ArrayList<String>(); } + public Interface(String type) { + this(new FullyQualifiedJavaType(type)); + } + public Set<FullyQualifiedJavaType> getImportedTypes() { return Collections.unmodifiableSet(importedTypes); } Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/dom/java/TopLevelClass.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/dom/java/TopLevelClass.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/dom/java/TopLevelClass.java (original) +++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/dom/java/TopLevelClass.java Wed Jun 3 03:49:27 2009 @@ -39,8 +39,12 @@ super(type); importedTypes = new TreeSet<FullyQualifiedJavaType>(); fileCommentLines = new ArrayList<String>(); -} + } + public TopLevelClass(String typeName) { + this(new FullyQualifiedJavaType(typeName)); + } + /** * @return Returns the importedTypes. */ Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/config/MergeConstants.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/config/MergeConstants.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/config/MergeConstants.java (original) +++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/config/MergeConstants.java Wed Jun 3 03:49:27 2009 @@ -31,7 +31,6 @@ private MergeConstants() { } - public static final String NEW_XML_ELEMENT_PREFIX = "ibatorgenerated_"; //$NON-NLS-1$ public static final String[] OLD_XML_ELEMENT_PREFIXES = {"ibatorgenerated_", "abatorgenerated_"}; //$NON-NLS-1$ //$NON-NLS-2$ Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/DAOGenerator.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/DAOGenerator.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/DAOGenerator.java (original) +++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/DAOGenerator.java Wed Jun 3 03:49:27 2009 @@ -103,8 +103,8 @@ } protected TopLevelClass getTopLevelClassShell() { - FullyQualifiedJavaType interfaceType = introspectedTable.getDAOInterfaceType(); - FullyQualifiedJavaType implementationType = introspectedTable.getDAOImplementationType(); + FullyQualifiedJavaType interfaceType = new FullyQualifiedJavaType(introspectedTable.getDAOInterfaceType()); + FullyQualifiedJavaType implementationType = new FullyQualifiedJavaType(introspectedTable.getDAOImplementationType()); CommentGenerator commentGenerator = ibatorContext.getCommentGenerator(); @@ -139,7 +139,7 @@ } protected Interface getInterfaceShell() { - Interface answer = new Interface(introspectedTable.getDAOInterfaceType()); + Interface answer = new Interface(new FullyQualifiedJavaType(introspectedTable.getDAOInterfaceType())); answer.setVisibility(JavaVisibility.PUBLIC); String rootInterface = introspectedTable.getTableConfigurationProperty(PropertyRegistry.ANY_ROOT_INTERFACE); Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/CountByExampleMethodGenerator.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/CountByExampleMethodGenerator.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/CountByExampleMethodGenerator.java (original) +++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/CountByExampleMethodGenerator.java Wed Jun 3 03:49:27 2009 @@ -78,7 +78,7 @@ } private Method getMethodShell(Set<FullyQualifiedJavaType> importedTypes) { - FullyQualifiedJavaType type = introspectedTable.getExampleType(); + FullyQualifiedJavaType type = new FullyQualifiedJavaType(introspectedTable.getExampleType()); importedTypes.add(type); Method method = new Method(); Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/DeleteByExampleMethodGenerator.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/DeleteByExampleMethodGenerator.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/DeleteByExampleMethodGenerator.java (original) +++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/DeleteByExampleMethodGenerator.java Wed Jun 3 03:49:27 2009 @@ -68,7 +68,7 @@ } private Method getMethodShell(Set<FullyQualifiedJavaType> importedTypes) { - FullyQualifiedJavaType type = introspectedTable.getExampleType(); + FullyQualifiedJavaType type = new FullyQualifiedJavaType(introspectedTable.getExampleType()); importedTypes.add(type); Method method = new Method(); Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/DeleteByPrimaryKeyMethodGenerator.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/DeleteByPrimaryKeyMethodGenerator.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/DeleteByPrimaryKeyMethodGenerator.java (original) +++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/DeleteByPrimaryKeyMethodGenerator.java Wed Jun 3 03:49:27 2009 @@ -48,8 +48,8 @@ if (!introspectedTable.getRules().generatePrimaryKeyClass()) { // no primary key class, but primary key is enabled. Primary // key columns must be in the base class. - FullyQualifiedJavaType keyType = introspectedTable - .getBaseRecordType(); + FullyQualifiedJavaType keyType = + new FullyQualifiedJavaType(introspectedTable.getBaseRecordType()); topLevelClass.addImportedType(keyType); sb.setLength(0); @@ -103,7 +103,7 @@ .getDeleteByPrimaryKeyMethodName(introspectedTable)); if (introspectedTable.getRules().generatePrimaryKeyClass()) { - FullyQualifiedJavaType type = introspectedTable.getPrimaryKeyType(); + FullyQualifiedJavaType type = new FullyQualifiedJavaType(introspectedTable.getPrimaryKeyType()); importedTypes.add(type); method.addParameter(new Parameter(type, "key")); //$NON-NLS-1$ } else { Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/SelectByExampleWithBLOBsMethodGenerator.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/SelectByExampleWithBLOBsMethodGenerator.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/SelectByExampleWithBLOBsMethodGenerator.java (original) +++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/SelectByExampleWithBLOBsMethodGenerator.java Wed Jun 3 03:49:27 2009 @@ -78,7 +78,7 @@ } private Method getMethodShell(Set<FullyQualifiedJavaType> importedTypes) { - FullyQualifiedJavaType type = introspectedTable.getExampleType(); + FullyQualifiedJavaType type = new FullyQualifiedJavaType(introspectedTable.getExampleType()); importedTypes.add(type); importedTypes.add(FullyQualifiedJavaType.getNewListInstance()); @@ -90,10 +90,10 @@ if (generateForJava5) { FullyQualifiedJavaType fqjt; if (introspectedTable.getRules().generateRecordWithBLOBsClass()) { - fqjt = introspectedTable.getRecordWithBLOBsType(); + fqjt = new FullyQualifiedJavaType(introspectedTable.getRecordWithBLOBsType()); } else { // the blob fields must be rolled up into the base class - fqjt = introspectedTable.getBaseRecordType(); + fqjt = new FullyQualifiedJavaType(introspectedTable.getBaseRecordType()); } importedTypes.add(fqjt); Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/SelectByExampleWithoutBLOBsMethodGenerator.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/SelectByExampleWithoutBLOBsMethodGenerator.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/SelectByExampleWithoutBLOBsMethodGenerator.java (original) +++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/SelectByExampleWithoutBLOBsMethodGenerator.java Wed Jun 3 03:49:27 2009 @@ -78,7 +78,7 @@ } private Method getMethodShell(Set<FullyQualifiedJavaType> importedTypes) { - FullyQualifiedJavaType type = introspectedTable.getExampleType(); + FullyQualifiedJavaType type = new FullyQualifiedJavaType(introspectedTable.getExampleType()); importedTypes.add(type); importedTypes.add(FullyQualifiedJavaType.getNewListInstance()); @@ -91,9 +91,9 @@ if (generateForJava5) { FullyQualifiedJavaType fqjt; if (introspectedTable.getRules().generateBaseRecordClass()) { - fqjt = introspectedTable.getBaseRecordType(); + fqjt = new FullyQualifiedJavaType(introspectedTable.getBaseRecordType()); } else if (introspectedTable.getRules().generatePrimaryKeyClass()) { - fqjt = introspectedTable.getPrimaryKeyType(); + fqjt = new FullyQualifiedJavaType(introspectedTable.getPrimaryKeyType()); } else { throw new RuntimeException(Messages .getString("RuntimeError.12")); //$NON-NLS-1$ Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/SelectByPrimaryKeyMethodGenerator.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/SelectByPrimaryKeyMethodGenerator.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/SelectByPrimaryKeyMethodGenerator.java (original) +++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/SelectByPrimaryKeyMethodGenerator.java Wed Jun 3 03:49:27 2009 @@ -49,8 +49,8 @@ if (!introspectedTable.getRules().generatePrimaryKeyClass()) { // no primary key class, but primary key is enabled. Primary // key columns must be in the base class. - FullyQualifiedJavaType keyType = introspectedTable - .getBaseRecordType(); + FullyQualifiedJavaType keyType = + new FullyQualifiedJavaType(introspectedTable.getBaseRecordType()); topLevelClass.addImportedType(keyType); sb.setLength(0); @@ -106,8 +106,8 @@ Method method = new Method(); method.setVisibility(JavaVisibility.PUBLIC); - FullyQualifiedJavaType returnType = introspectedTable.getRules() - .calculateAllFieldsClass(); + FullyQualifiedJavaType returnType = + introspectedTable.getRules().calculateAllFieldsClass(); method.setReturnType(returnType); importedTypes.add(returnType); @@ -115,7 +115,7 @@ .getSelectByPrimaryKeyMethodName(introspectedTable)); if (introspectedTable.getRules().generatePrimaryKeyClass()) { - FullyQualifiedJavaType type = introspectedTable.getPrimaryKeyType(); + FullyQualifiedJavaType type = new FullyQualifiedJavaType(introspectedTable.getPrimaryKeyType()); importedTypes.add(type); method.addParameter(new Parameter(type, "key")); //$NON-NLS-1$ } else { Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/UpdateByExampleParmsInnerclassGenerator.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/UpdateByExampleParmsInnerclassGenerator.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/UpdateByExampleParmsInnerclassGenerator.java (original) +++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/UpdateByExampleParmsInnerclassGenerator.java Wed Jun 3 03:49:27 2009 @@ -38,7 +38,7 @@ @Override public void addImplementationElements(TopLevelClass topLevelClass) { - topLevelClass.addImportedType(introspectedTable.getExampleType()); + topLevelClass.addImportedType(new FullyQualifiedJavaType(introspectedTable.getExampleType())); InnerClass innerClass = new InnerClass( new FullyQualifiedJavaType("UpdateByExampleParms")); //$NON-NLS-1$ @@ -55,7 +55,7 @@ new Parameter(FullyQualifiedJavaType.getObjectInstance(), "record")); //$NON-NLS-1$ method.addParameter( - new Parameter(introspectedTable.getExampleType(), + new Parameter(new FullyQualifiedJavaType(introspectedTable.getExampleType()), "example")); //$NON-NLS-1$ method.addBodyLine("super(example);"); //$NON-NLS-1$ method.addBodyLine("this.record = record;"); //$NON-NLS-1$ Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/UpdateByExampleSelectiveMethodGenerator.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/UpdateByExampleSelectiveMethodGenerator.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/UpdateByExampleSelectiveMethodGenerator.java (original) +++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/UpdateByExampleSelectiveMethodGenerator.java Wed Jun 3 03:49:27 2009 @@ -75,11 +75,11 @@ FullyQualifiedJavaType parameterType; if (introspectedTable.getRules().generateRecordWithBLOBsClass()) { - parameterType = introspectedTable.getRecordWithBLOBsType(); + parameterType = new FullyQualifiedJavaType(introspectedTable.getRecordWithBLOBsType()); } else if (introspectedTable.getRules().generateBaseRecordClass()) { - parameterType = introspectedTable.getBaseRecordType(); + parameterType = new FullyQualifiedJavaType(introspectedTable.getBaseRecordType()); } else { - parameterType = introspectedTable.getPrimaryKeyType(); + parameterType = new FullyQualifiedJavaType(introspectedTable.getPrimaryKeyType()); } importedTypes.add(parameterType); @@ -90,8 +90,8 @@ method.setName(getDAOMethodNameCalculator() .getUpdateByExampleSelectiveMethodName(introspectedTable)); method.addParameter(new Parameter(parameterType, "record")); //$NON-NLS-1$ - method.addParameter(new Parameter(introspectedTable.getExampleType(), - "example")); //$NON-NLS-1$ + method.addParameter(new Parameter( + new FullyQualifiedJavaType(introspectedTable.getExampleType()), "example")); //$NON-NLS-1$ for (FullyQualifiedJavaType fqjt : daoTemplate.getCheckedExceptions()) { method.addException(fqjt); Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/UpdateByExampleWithBLOBsMethodGenerator.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/UpdateByExampleWithBLOBsMethodGenerator.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/UpdateByExampleWithBLOBsMethodGenerator.java (original) +++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/UpdateByExampleWithBLOBsMethodGenerator.java Wed Jun 3 03:49:27 2009 @@ -75,9 +75,9 @@ private Method getMethodShell(Set<FullyQualifiedJavaType> importedTypes) { FullyQualifiedJavaType parameterType; if (introspectedTable.getRules().generateRecordWithBLOBsClass()) { - parameterType = introspectedTable.getRecordWithBLOBsType(); + parameterType = new FullyQualifiedJavaType(introspectedTable.getRecordWithBLOBsType()); } else { - parameterType = introspectedTable.getBaseRecordType(); + parameterType = new FullyQualifiedJavaType(introspectedTable.getBaseRecordType()); } importedTypes.add(parameterType); @@ -87,7 +87,8 @@ method.setReturnType(FullyQualifiedJavaType.getIntInstance()); method.setName(getDAOMethodNameCalculator().getUpdateByExampleWithBLOBsMethodName(introspectedTable)); method.addParameter(new Parameter(parameterType, "record")); //$NON-NLS-1$ - method.addParameter(new Parameter(introspectedTable.getExampleType(), "example")); //$NON-NLS-1$ + method.addParameter(new Parameter( + new FullyQualifiedJavaType(introspectedTable.getExampleType()), "example")); //$NON-NLS-1$ for (FullyQualifiedJavaType fqjt : daoTemplate.getCheckedExceptions()) { method.addException(fqjt); Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/UpdateByExampleWithoutBLOBsMethodGenerator.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/UpdateByExampleWithoutBLOBsMethodGenerator.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/UpdateByExampleWithoutBLOBsMethodGenerator.java (original) +++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/UpdateByExampleWithoutBLOBsMethodGenerator.java Wed Jun 3 03:49:27 2009 @@ -75,9 +75,9 @@ private Method getMethodShell(Set<FullyQualifiedJavaType> importedTypes) { FullyQualifiedJavaType parameterType; if (introspectedTable.getRules().generateBaseRecordClass()) { - parameterType = introspectedTable.getBaseRecordType(); + parameterType = new FullyQualifiedJavaType(introspectedTable.getBaseRecordType()); } else { - parameterType = introspectedTable.getPrimaryKeyType(); + parameterType = new FullyQualifiedJavaType(introspectedTable.getPrimaryKeyType()); } importedTypes.add(parameterType); @@ -87,7 +87,8 @@ method.setReturnType(FullyQualifiedJavaType.getIntInstance()); method.setName(getDAOMethodNameCalculator().getUpdateByExampleWithoutBLOBsMethodName(introspectedTable)); method.addParameter(new Parameter(parameterType, "record")); //$NON-NLS-1$ - method.addParameter(new Parameter(introspectedTable.getExampleType(), "example")); //$NON-NLS-1$ + method.addParameter(new Parameter( + new FullyQualifiedJavaType(introspectedTable.getExampleType()), "example")); //$NON-NLS-1$ for (FullyQualifiedJavaType fqjt : daoTemplate.getCheckedExceptions()) { method.addException(fqjt); Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/UpdateByPrimaryKeySelectiveMethodGenerator.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/UpdateByPrimaryKeySelectiveMethodGenerator.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/UpdateByPrimaryKeySelectiveMethodGenerator.java (original) +++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/UpdateByPrimaryKeySelectiveMethodGenerator.java Wed Jun 3 03:49:27 2009 @@ -72,9 +72,9 @@ FullyQualifiedJavaType parameterType; if (introspectedTable.getRules().generateRecordWithBLOBsClass()) { - parameterType = introspectedTable.getRecordWithBLOBsType(); + parameterType = new FullyQualifiedJavaType(introspectedTable.getRecordWithBLOBsType()); } else { - parameterType = introspectedTable.getBaseRecordType(); + parameterType = new FullyQualifiedJavaType(introspectedTable.getBaseRecordType()); } importedTypes.add(parameterType); Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/UpdateByPrimaryKeyWithBLOBsMethodGenerator.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/UpdateByPrimaryKeyWithBLOBsMethodGenerator.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/UpdateByPrimaryKeyWithBLOBsMethodGenerator.java (original) +++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/UpdateByPrimaryKeyWithBLOBsMethodGenerator.java Wed Jun 3 03:49:27 2009 @@ -72,9 +72,9 @@ FullyQualifiedJavaType parameterType; if (introspectedTable.getRules().generateRecordWithBLOBsClass()) { - parameterType = introspectedTable.getRecordWithBLOBsType(); + parameterType = new FullyQualifiedJavaType(introspectedTable.getRecordWithBLOBsType()); } else { - parameterType = introspectedTable.getBaseRecordType(); + parameterType = new FullyQualifiedJavaType(introspectedTable.getBaseRecordType()); } importedTypes.add(parameterType); Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/UpdateByPrimaryKeyWithoutBLOBsMethodGenerator.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/UpdateByPrimaryKeyWithoutBLOBsMethodGenerator.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/UpdateByPrimaryKeyWithoutBLOBsMethodGenerator.java (original) +++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/dao/elements/UpdateByPrimaryKeyWithoutBLOBsMethodGenerator.java Wed Jun 3 03:49:27 2009 @@ -70,7 +70,7 @@ private Method getMethodShell(Set<FullyQualifiedJavaType> importedTypes) { FullyQualifiedJavaType parameterType = - introspectedTable.getBaseRecordType(); + new FullyQualifiedJavaType(introspectedTable.getBaseRecordType()); importedTypes.add(parameterType); Method method = new Method(); Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/model/BaseRecordGenerator.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/model/BaseRecordGenerator.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/model/BaseRecordGenerator.java (original) +++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/model/BaseRecordGenerator.java Wed Jun 3 03:49:27 2009 @@ -49,8 +49,7 @@ IbatorPlugin plugins = ibatorContext.getPlugins(); CommentGenerator commentGenerator = ibatorContext.getCommentGenerator(); - FullyQualifiedJavaType type = introspectedTable.getBaseRecordType(); - TopLevelClass topLevelClass = new TopLevelClass(type); + TopLevelClass topLevelClass = new TopLevelClass(introspectedTable.getBaseRecordType()); topLevelClass.setVisibility(JavaVisibility.PUBLIC); commentGenerator.addJavaFileComment(topLevelClass); @@ -111,7 +110,7 @@ private FullyQualifiedJavaType getSuperClass() { FullyQualifiedJavaType superClass; if (introspectedTable.getRules().generatePrimaryKeyClass()) { - superClass = introspectedTable.getPrimaryKeyType(); + superClass = new FullyQualifiedJavaType(introspectedTable.getPrimaryKeyType()); } else { String rootClass = getRootClass(); if (rootClass != null) { Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/model/ExampleGenerator.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/model/ExampleGenerator.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/model/ExampleGenerator.java (original) +++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/model/ExampleGenerator.java Wed Jun 3 03:49:27 2009 @@ -60,7 +60,7 @@ Messages.getString("Progress.6", table.toString())); //$NON-NLS-1$ CommentGenerator commentGenerator = ibatorContext.getCommentGenerator(); - FullyQualifiedJavaType type = introspectedTable.getExampleType(); + FullyQualifiedJavaType type = new FullyQualifiedJavaType(introspectedTable.getExampleType()); TopLevelClass topLevelClass = new TopLevelClass(type); topLevelClass.setVisibility(JavaVisibility.PUBLIC); commentGenerator.addJavaFileComment(topLevelClass); Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/model/PrimaryKeyGenerator.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/model/PrimaryKeyGenerator.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/model/PrimaryKeyGenerator.java (original) +++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/model/PrimaryKeyGenerator.java Wed Jun 3 03:49:27 2009 @@ -53,8 +53,7 @@ IbatorPlugin plugins = ibatorContext.getPlugins(); CommentGenerator commentGenerator = ibatorContext.getCommentGenerator(); - FullyQualifiedJavaType type = introspectedTable.getPrimaryKeyType(); - TopLevelClass topLevelClass = new TopLevelClass(type); + TopLevelClass topLevelClass = new TopLevelClass(introspectedTable.getPrimaryKeyType()); topLevelClass.setVisibility(JavaVisibility.PUBLIC); commentGenerator.addJavaFileComment(topLevelClass); Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/model/RecordWithBLOBsGenerator.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/model/RecordWithBLOBsGenerator.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/model/RecordWithBLOBsGenerator.java (original) +++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/model/RecordWithBLOBsGenerator.java Wed Jun 3 03:49:27 2009 @@ -24,7 +24,6 @@ import org.apache.ibatis.ibator.api.IntrospectedColumn; import org.apache.ibatis.ibator.api.dom.java.CompilationUnit; import org.apache.ibatis.ibator.api.dom.java.Field; -import org.apache.ibatis.ibator.api.dom.java.FullyQualifiedJavaType; import org.apache.ibatis.ibator.api.dom.java.JavaVisibility; import org.apache.ibatis.ibator.api.dom.java.Method; import org.apache.ibatis.ibator.api.dom.java.TopLevelClass; @@ -53,18 +52,17 @@ IbatorPlugin plugins = ibatorContext.getPlugins(); CommentGenerator commentGenerator = ibatorContext.getCommentGenerator(); - FullyQualifiedJavaType type = introspectedTable.getRecordWithBLOBsType(); - TopLevelClass topLevelClass = new TopLevelClass(type); + TopLevelClass topLevelClass = new TopLevelClass(introspectedTable.getRecordWithBLOBsType()); topLevelClass.setVisibility(JavaVisibility.PUBLIC); commentGenerator.addJavaFileComment(topLevelClass); - String rootClass = getRootClass(); if (introspectedTable.getRules().generateBaseRecordClass()) { topLevelClass.setSuperClass(introspectedTable.getBaseRecordType()); } else { topLevelClass.setSuperClass(introspectedTable.getPrimaryKeyType()); } + String rootClass = getRootClass(); for (IntrospectedColumn introspectedColumn : introspectedTable.getBLOBColumns()) { if (RootClassInfo.getInstance(rootClass, warnings).containsProperty(introspectedColumn)) { continue; Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/CountByExampleElementGenerator.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/CountByExampleElementGenerator.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/CountByExampleElementGenerator.java (original) +++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/CountByExampleElementGenerator.java Wed Jun 3 03:49:27 2009 @@ -15,7 +15,6 @@ */ package org.apache.ibatis.ibator.generator.ibatis2.sqlmap.elements; -import org.apache.ibatis.ibator.api.dom.java.FullyQualifiedJavaType; import org.apache.ibatis.ibator.api.dom.xml.Attribute; import org.apache.ibatis.ibator.api.dom.xml.TextElement; import org.apache.ibatis.ibator.api.dom.xml.XmlElement; @@ -35,13 +34,11 @@ public void addElements(XmlElement parentElement) { XmlElement answer = new XmlElement("select"); //$NON-NLS-1$ - FullyQualifiedJavaType fqjt = introspectedTable.getExampleType(); - answer .addAttribute(new Attribute( "id", introspectedTable.getCountByExampleStatementId())); //$NON-NLS-1$ answer.addAttribute(new Attribute( - "parameterClass", fqjt.getFullyQualifiedName())); //$NON-NLS-1$ + "parameterClass", introspectedTable.getExampleType())); //$NON-NLS-1$ answer.addAttribute(new Attribute( "resultClass", "java.lang.Integer")); //$NON-NLS-1$ //$NON-NLS-2$ Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/DeleteByExampleElementGenerator.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/DeleteByExampleElementGenerator.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/DeleteByExampleElementGenerator.java (original) +++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/DeleteByExampleElementGenerator.java Wed Jun 3 03:49:27 2009 @@ -15,7 +15,6 @@ */ package org.apache.ibatis.ibator.generator.ibatis2.sqlmap.elements; -import org.apache.ibatis.ibator.api.dom.java.FullyQualifiedJavaType; import org.apache.ibatis.ibator.api.dom.xml.Attribute; import org.apache.ibatis.ibator.api.dom.xml.TextElement; import org.apache.ibatis.ibator.api.dom.xml.XmlElement; @@ -35,13 +34,11 @@ public void addElements(XmlElement parentElement) { XmlElement answer = new XmlElement("delete"); //$NON-NLS-1$ - FullyQualifiedJavaType fqjt = introspectedTable.getExampleType(); - answer .addAttribute(new Attribute( "id", introspectedTable.getDeleteByExampleStatementId())); //$NON-NLS-1$ answer.addAttribute(new Attribute( - "parameterClass", fqjt.getFullyQualifiedName())); //$NON-NLS-1$ + "parameterClass", introspectedTable.getExampleType())); //$NON-NLS-1$ ibatorContext.getCommentGenerator().addComment(answer); Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/DeleteByPrimaryKeyElementGenerator.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/DeleteByPrimaryKeyElementGenerator.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/DeleteByPrimaryKeyElementGenerator.java (original) +++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/DeleteByPrimaryKeyElementGenerator.java Wed Jun 3 03:49:27 2009 @@ -16,7 +16,6 @@ package org.apache.ibatis.ibator.generator.ibatis2.sqlmap.elements; import org.apache.ibatis.ibator.api.IntrospectedColumn; -import org.apache.ibatis.ibator.api.dom.java.FullyQualifiedJavaType; import org.apache.ibatis.ibator.api.dom.xml.Attribute; import org.apache.ibatis.ibator.api.dom.xml.TextElement; import org.apache.ibatis.ibator.api.dom.xml.XmlElement; @@ -39,14 +38,14 @@ answer.addAttribute(new Attribute( "id", introspectedTable.getDeleteByPrimaryKeyStatementId())); //$NON-NLS-1$ - FullyQualifiedJavaType parameterClass; + String parameterClass; if (introspectedTable.getRules().generatePrimaryKeyClass()) { parameterClass = introspectedTable.getPrimaryKeyType(); } else { parameterClass = introspectedTable.getBaseRecordType(); } answer.addAttribute(new Attribute("parameterClass", //$NON-NLS-1$ - parameterClass.getFullyQualifiedName())); + parameterClass)); ibatorContext.getCommentGenerator().addComment(answer); Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/ResultMapWithBLOBsElementGenerator.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/ResultMapWithBLOBsElementGenerator.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/ResultMapWithBLOBsElementGenerator.java (original) +++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/ResultMapWithBLOBsElementGenerator.java Wed Jun 3 03:49:27 2009 @@ -16,7 +16,6 @@ package org.apache.ibatis.ibator.generator.ibatis2.sqlmap.elements; import org.apache.ibatis.ibator.api.IntrospectedColumn; -import org.apache.ibatis.ibator.api.dom.java.FullyQualifiedJavaType; import org.apache.ibatis.ibator.api.dom.xml.Attribute; import org.apache.ibatis.ibator.api.dom.xml.XmlElement; import org.apache.ibatis.ibator.config.PropertyRegistry; @@ -44,7 +43,7 @@ answer.addAttribute(new Attribute("id", //$NON-NLS-1$ introspectedTable.getResultMapWithBLOBsId())); - FullyQualifiedJavaType returnType; + String returnType; if (introspectedTable.getRules().generateRecordWithBLOBsClass()) { returnType = introspectedTable.getRecordWithBLOBsType(); } else { @@ -54,7 +53,7 @@ } answer.addAttribute(new Attribute("class", //$NON-NLS-1$ - returnType.getFullyQualifiedName())); + returnType)); StringBuilder sb = new StringBuilder(); sb.append(introspectedTable.getSqlMapNamespace()); Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/ResultMapWithoutBLOBsElementGenerator.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/ResultMapWithoutBLOBsElementGenerator.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/ResultMapWithoutBLOBsElementGenerator.java (original) +++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/ResultMapWithoutBLOBsElementGenerator.java Wed Jun 3 03:49:27 2009 @@ -16,7 +16,6 @@ package org.apache.ibatis.ibator.generator.ibatis2.sqlmap.elements; import org.apache.ibatis.ibator.api.IntrospectedColumn; -import org.apache.ibatis.ibator.api.dom.java.FullyQualifiedJavaType; import org.apache.ibatis.ibator.api.dom.xml.Attribute; import org.apache.ibatis.ibator.api.dom.xml.XmlElement; import org.apache.ibatis.ibator.config.PropertyRegistry; @@ -42,7 +41,7 @@ answer.addAttribute(new Attribute("id", //$NON-NLS-1$ introspectedTable.getBaseResultMapId())); - FullyQualifiedJavaType returnType; + String returnType; if (introspectedTable.getRules().generateBaseRecordClass()) { returnType = introspectedTable.getBaseRecordType(); } else { @@ -50,7 +49,7 @@ } answer.addAttribute(new Attribute("class", //$NON-NLS-1$ - returnType.getFullyQualifiedName())); + returnType)); ibatorContext.getCommentGenerator().addComment(answer); Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/SelectByExampleWithBLOBsElementGenerator.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/SelectByExampleWithBLOBsElementGenerator.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/SelectByExampleWithBLOBsElementGenerator.java (original) +++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/SelectByExampleWithBLOBsElementGenerator.java Wed Jun 3 03:49:27 2009 @@ -15,7 +15,6 @@ */ package org.apache.ibatis.ibator.generator.ibatis2.sqlmap.elements; -import org.apache.ibatis.ibator.api.dom.java.FullyQualifiedJavaType; import org.apache.ibatis.ibator.api.dom.xml.Attribute; import org.apache.ibatis.ibator.api.dom.xml.TextElement; import org.apache.ibatis.ibator.api.dom.xml.XmlElement; @@ -35,15 +34,13 @@ @Override public void addElements(XmlElement parentElement) { - FullyQualifiedJavaType fqjt = introspectedTable.getExampleType(); - XmlElement answer = new XmlElement("select"); //$NON-NLS-1$ answer.addAttribute(new Attribute( "id", introspectedTable.getSelectByExampleWithBLOBsStatementId())); //$NON-NLS-1$ answer.addAttribute(new Attribute( "resultMap", introspectedTable.getResultMapWithBLOBsId())); //$NON-NLS-1$ answer.addAttribute(new Attribute( - "parameterClass", fqjt.getFullyQualifiedName())); //$NON-NLS-1$ + "parameterClass", introspectedTable.getExampleType())); //$NON-NLS-1$ ibatorContext.getCommentGenerator().addComment(answer); Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/SelectByExampleWithoutBLOBsElementGenerator.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/SelectByExampleWithoutBLOBsElementGenerator.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/SelectByExampleWithoutBLOBsElementGenerator.java (original) +++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/SelectByExampleWithoutBLOBsElementGenerator.java Wed Jun 3 03:49:27 2009 @@ -15,7 +15,6 @@ */ package org.apache.ibatis.ibator.generator.ibatis2.sqlmap.elements; -import org.apache.ibatis.ibator.api.dom.java.FullyQualifiedJavaType; import org.apache.ibatis.ibator.api.dom.xml.Attribute; import org.apache.ibatis.ibator.api.dom.xml.TextElement; import org.apache.ibatis.ibator.api.dom.xml.XmlElement; @@ -34,8 +33,6 @@ @Override public void addElements(XmlElement parentElement) { - FullyQualifiedJavaType fqjt = introspectedTable.getExampleType(); - XmlElement answer = new XmlElement("select"); //$NON-NLS-1$ answer.addAttribute(new Attribute("id", //$NON-NLS-1$ @@ -44,7 +41,7 @@ .addAttribute(new Attribute( "resultMap", introspectedTable.getBaseResultMapId())); //$NON-NLS-1$ answer.addAttribute(new Attribute( - "parameterClass", fqjt.getFullyQualifiedName())); //$NON-NLS-1$ + "parameterClass", introspectedTable.getExampleType())); //$NON-NLS-1$ ibatorContext.getCommentGenerator().addComment(answer); Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/SelectByPrimaryKeyElementGenerator.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/SelectByPrimaryKeyElementGenerator.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/SelectByPrimaryKeyElementGenerator.java (original) +++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/SelectByPrimaryKeyElementGenerator.java Wed Jun 3 03:49:27 2009 @@ -16,7 +16,6 @@ package org.apache.ibatis.ibator.generator.ibatis2.sqlmap.elements; import org.apache.ibatis.ibator.api.IntrospectedColumn; -import org.apache.ibatis.ibator.api.dom.java.FullyQualifiedJavaType; import org.apache.ibatis.ibator.api.dom.xml.Attribute; import org.apache.ibatis.ibator.api.dom.xml.TextElement; import org.apache.ibatis.ibator.api.dom.xml.XmlElement; @@ -48,7 +47,7 @@ introspectedTable.getBaseResultMapId())); } - FullyQualifiedJavaType parameterType; + String parameterType; if (introspectedTable.getRules().generatePrimaryKeyClass()) { parameterType = introspectedTable.getPrimaryKeyType(); } else { @@ -58,7 +57,7 @@ } answer.addAttribute(new Attribute("parameterClass", //$NON-NLS-1$ - parameterType.getFullyQualifiedName())); + parameterType)); ibatorContext.getCommentGenerator().addComment(answer); Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/UpdateByPrimaryKeySelectiveElementGenerator.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/UpdateByPrimaryKeySelectiveElementGenerator.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/UpdateByPrimaryKeySelectiveElementGenerator.java (original) +++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/UpdateByPrimaryKeySelectiveElementGenerator.java Wed Jun 3 03:49:27 2009 @@ -16,7 +16,6 @@ package org.apache.ibatis.ibator.generator.ibatis2.sqlmap.elements; import org.apache.ibatis.ibator.api.IntrospectedColumn; -import org.apache.ibatis.ibator.api.dom.java.FullyQualifiedJavaType; import org.apache.ibatis.ibator.api.dom.xml.Attribute; import org.apache.ibatis.ibator.api.dom.xml.TextElement; import org.apache.ibatis.ibator.api.dom.xml.XmlElement; @@ -41,7 +40,7 @@ answer.addAttribute(new Attribute( "id", introspectedTable.getUpdateByPrimaryKeySelectiveStatementId())); //$NON-NLS-1$ - FullyQualifiedJavaType parameterType; + String parameterType; if (introspectedTable.getRules().generateRecordWithBLOBsClass()) { parameterType = introspectedTable.getRecordWithBLOBsType(); @@ -50,7 +49,7 @@ } answer.addAttribute(new Attribute("parameterClass", //$NON-NLS-1$ - parameterType.getFullyQualifiedName())); + parameterType)); ibatorContext.getCommentGenerator().addComment(answer); Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/UpdateByPrimaryKeyWithBLOBsElementGenerator.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/UpdateByPrimaryKeyWithBLOBsElementGenerator.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/UpdateByPrimaryKeyWithBLOBsElementGenerator.java (original) +++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/UpdateByPrimaryKeyWithBLOBsElementGenerator.java Wed Jun 3 03:49:27 2009 @@ -19,7 +19,6 @@ import org.apache.ibatis.ibator.api.IntrospectedColumn; import org.apache.ibatis.ibator.api.dom.OutputUtilities; -import org.apache.ibatis.ibator.api.dom.java.FullyQualifiedJavaType; import org.apache.ibatis.ibator.api.dom.xml.Attribute; import org.apache.ibatis.ibator.api.dom.xml.TextElement; import org.apache.ibatis.ibator.api.dom.xml.XmlElement; @@ -44,7 +43,7 @@ answer.addAttribute(new Attribute( "id", introspectedTable.getUpdateByPrimaryKeyWithBLOBsStatementId())); //$NON-NLS-1$ - FullyQualifiedJavaType parameterType; + String parameterType; if (introspectedTable.getRules().generateRecordWithBLOBsClass()) { parameterType = introspectedTable.getRecordWithBLOBsType(); @@ -53,7 +52,7 @@ } answer.addAttribute(new Attribute("parameterClass", //$NON-NLS-1$ - parameterType.getFullyQualifiedName())); + parameterType)); ibatorContext.getCommentGenerator().addComment(answer); Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/UpdateByPrimaryKeyWithoutBLOBsElementGenerator.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/UpdateByPrimaryKeyWithoutBLOBsElementGenerator.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/UpdateByPrimaryKeyWithoutBLOBsElementGenerator.java (original) +++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/generator/ibatis2/sqlmap/elements/UpdateByPrimaryKeyWithoutBLOBsElementGenerator.java Wed Jun 3 03:49:27 2009 @@ -43,7 +43,7 @@ answer.addAttribute(new Attribute( "id", introspectedTable.getUpdateByPrimaryKeyStatementId())); //$NON-NLS-1$ answer.addAttribute(new Attribute("parameterClass", //$NON-NLS-1$ - introspectedTable.getBaseRecordType().getFullyQualifiedName())); + introspectedTable.getBaseRecordType())); ibatorContext.getCommentGenerator().addComment(answer); Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/DefaultCommentGenerator.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/DefaultCommentGenerator.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/DefaultCommentGenerator.java (original) +++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/DefaultCommentGenerator.java Wed Jun 3 03:49:27 2009 @@ -250,12 +250,17 @@ */ public void addComment(XmlElement xmlElement) { xmlElement.addElement(new TextElement("<!--")); //$NON-NLS-1$ + + StringBuilder sb = new StringBuilder(); + sb.append(" WARNING - "); //$NON-NLS-1$ + sb.append(MergeConstants.NEW_JAVA_ELEMENT_TAG); + xmlElement.addElement(new TextElement(sb.toString())); xmlElement.addElement(new TextElement( - " WARNING - This element is automatically generated by Apache iBATIS Ibator, do not modify.")); //$NON-NLS-1$ + " This element is automatically generated by Apache iBATIS Ibator, do not modify.")); //$NON-NLS-1$ String s = getDateString(); if (s != null) { - StringBuilder sb = new StringBuilder(); + sb.setLength(0); sb.append(" This element was generated on "); //$NON-NLS-1$ sb.append(s); sb.append('.'); Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/XmlFileMergerJaxp.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/XmlFileMergerJaxp.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/XmlFileMergerJaxp.java (original) +++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/XmlFileMergerJaxp.java Wed Jun 3 03:49:27 2009 @@ -28,6 +28,7 @@ import org.apache.ibatis.ibator.config.MergeConstants; import org.apache.ibatis.ibator.exception.ShellException; import org.apache.ibatis.ibator.internal.util.messages.Messages; +import org.w3c.dom.Comment; import org.w3c.dom.Document; import org.w3c.dom.DocumentType; import org.w3c.dom.Element; @@ -178,8 +179,30 @@ } } } - } + if (rc == false) { + // check for new node format - if the first non-whitespace node + // is an XML comment, and the comment include "@ibatorgenerated", + // then it is an ibator node + NodeList children = node.getChildNodes(); + int length = children.getLength(); + for (int i = 0; i < length; i++) { + Node childNode = children.item(i); + if (isWhiteSpace(childNode)) { + continue; + } else if (childNode.getNodeType() == Node.COMMENT_NODE) { + Comment comment = (Comment) childNode; + if (comment.getData().indexOf(MergeConstants.NEW_JAVA_ELEMENT_TAG) != -1) { + rc = true; + break; + } + } else { + break; + } + } + } + } + return rc; } Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/rules/BaseIbatorRules.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/rules/BaseIbatorRules.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/rules/BaseIbatorRules.java (original) +++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/rules/BaseIbatorRules.java Wed Jun 3 03:49:27 2009 @@ -72,7 +72,7 @@ */ public FullyQualifiedJavaType calculateAllFieldsClass() { - FullyQualifiedJavaType answer; + String answer; if (generateRecordWithBLOBsClass()) { answer = introspectedTable.getRecordWithBLOBsType(); @@ -82,7 +82,7 @@ answer = introspectedTable.getPrimaryKeyType(); } - return answer; + return new FullyQualifiedJavaType(answer); } /** Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/plugins/RenameExampleClassPlugin.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/plugins/RenameExampleClassPlugin.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/plugins/RenameExampleClassPlugin.java (original) +++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/plugins/RenameExampleClassPlugin.java Wed Jun 3 03:49:27 2009 @@ -22,7 +22,6 @@ import org.apache.ibatis.ibator.api.IbatorPluginAdapter; import org.apache.ibatis.ibator.api.IntrospectedTable; -import org.apache.ibatis.ibator.api.dom.java.FullyQualifiedJavaType; import org.apache.ibatis.ibator.internal.util.StringUtility; import org.apache.ibatis.ibator.internal.util.messages.Messages; @@ -93,12 +92,10 @@ @Override public void initialized(IntrospectedTable introspectedTable) { - FullyQualifiedJavaType oldType = introspectedTable.getExampleType(); + String oldType = introspectedTable.getExampleType(); + Matcher matcher = pattern.matcher(oldType); + oldType = matcher.replaceAll(replaceString); - String typeName = oldType.getFullyQualifiedName(); - Matcher matcher = pattern.matcher(typeName); - typeName = matcher.replaceAll(replaceString); - - introspectedTable.setExampleType(new FullyQualifiedJavaType(typeName)); + introspectedTable.setExampleType(oldType); } } Modified: ibatis/trunk/java/tools/ibator/core/testJava5/ibatortest/execute/miscellaneous/MiscellaneousTests.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/testJava5/ibatortest/execute/miscellaneous/MiscellaneousTests.java?rev=781254&r1=781253&r2=781254&view=diff ============================================================================== --- ibatis/trunk/java/tools/ibator/core/testJava5/ibatortest/execute/miscellaneous/MiscellaneousTests.java (original) +++ ibatis/trunk/java/tools/ibator/core/testJava5/ibatortest/execute/miscellaneous/MiscellaneousTests.java Wed Jun 3 03:49:27 2009 @@ -903,13 +903,13 @@ record.setSelect("select"); record.setInsert("insert"); - sqlMap.insert("ANOTHERAWFULTABLE.ibatorgenerated_insert", record); + sqlMap.insert("ANOTHERAWFULTABLE.insert", record); Anotherawfultable key = new Anotherawfultable(); key.setId(5); Anotherawfultable returnedRecord = (Anotherawfultable) - sqlMap.queryForObject("ANOTHERAWFULTABLE.ibatorgenerated_selectByPrimaryKey", + sqlMap.queryForObject("ANOTHERAWFULTABLE.selectByPrimaryKey", key); assertEquals(record.getId(), returnedRecord.getId()); From commitsmillerrobert@example.com Thu Jun 04 04:53:30 2009 Return-Path: <commitsmillerrobert@example.com> Delivered-To: millerrobert@example.com Received: (qmail 55582 invoked from network); 4 Jun 2009 04:53:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 4 Jun 2009 04:53:30 -0000 Received: (qmail 23379 invoked by uid 500); 4 Jun 2009 04:53:42 -0000 Delivered-To: millerrobert@example.com Received: (qmail 23340 invoked by uid 500); 4 Jun 2009 04:53:42 -0000 Mailing-List: contact millerrobert@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:millerrobert@example.com> List-Unsubscribe: <mailto:millerrobert@example.com> List-Post: <mailto:millerrobert@example.com> List-Id: <commits.ibatis.apache.org> Reply-To: millerrobert@example.com Delivered-To: mailing list millerrobert@example.com Received: (qmail 23331 invoked by uid 99); 4 Jun 2009 04:53:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Jun 2009 04:53:42 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Jun 2009 04:53:37 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id BD9212388896; Thu, 4 Jun 2009 04:53:15 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r781652 - in /ibatis/trunk/java/ibatis-3/ibatis-3-core/src: main/java/org/apache/ibatis/builder/ main/java/org/apache/ibatis/builder/annotation/ main/java/org/apache/ibatis/builder/xml/ main/java/org/apache/ibatis/builder/xml/dynamic/ main/... Date: Thu, 04 Jun 2009 04:53:15 -0000 To: millerrobert@example.com From: millerrobert@example.com X-Mailer: svnmailer-1.0.8 Message-Id: <millerrobert@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: cbegin Date: Thu Jun 4 04:53:14 2009 New Revision: 781652 URL: http://svn.apache.org/viewvc?rev=781652&view=rev Log: Fixed building of mapper config with minimal (or even no) elements. Fixed spelling error in BuilderException.java Added: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/BuilderException.java - copied, changed from r780275, ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/BulderException.java ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/builder/MinimalMapperConfig.xml ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/builder/XmlConfigBuilderTest.java Removed: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/BulderException.java Modified: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/BaseBuilder.java ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/MapperBuilderAssistant.java ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/SqlSourceBuilder.java ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/annotation/MapperAnnotationBuilder.java ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/annotation/ProviderSqlSource.java ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/xml/XMLConfigBuilder.java ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/xml/XMLStatementBuilder.java ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/xml/dynamic/ExpressionEvaluator.java ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/xml/ibatis-3-config.dtd ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/parsing/XPathParser.java ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/exceptions/GeneralExceptionsTest.java Modified: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/BaseBuilder.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/BaseBuilder.java?rev=781652&r1=781651&r2=781652&view=diff ============================================================================== --- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/BaseBuilder.java (original) +++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/BaseBuilder.java Thu Jun 4 04:53:14 2009 @@ -35,7 +35,7 @@ try { return JdbcType.valueOf(resolveAlias(alias)); } catch (IllegalArgumentException e) { - throw new BulderException("Error resolving JdbcType. Cause: " + e, e); + throw new BuilderException("Error resolving JdbcType. Cause: " + e, e); } } @@ -44,7 +44,7 @@ try { return ResultSetType.valueOf(resolveAlias(alias)); } catch (IllegalArgumentException e) { - throw new BulderException("Error resolving ResultSetType. Cause: " + e, e); + throw new BuilderException("Error resolving ResultSetType. Cause: " + e, e); } } @@ -53,7 +53,7 @@ try { return ParameterMode.valueOf(resolveAlias(alias)); } catch (IllegalArgumentException e) { - throw new BulderException("Error resolving ParameterMode. Cause: " + e, e); + throw new BuilderException("Error resolving ParameterMode. Cause: " + e, e); } } @@ -62,7 +62,7 @@ try { return Class.forName(resolveAlias(alias)); } catch (ClassNotFoundException e) { - throw new BulderException("Error resolving class . Cause: " + e, e); + throw new BuilderException("Error resolving class . Cause: " + e, e); } } @@ -72,7 +72,7 @@ Class type = resolveClass(alias); return type.newInstance(); } catch (Exception e) { - throw new BulderException("Error instantiating class. Cause: " + e, e); + throw new BuilderException("Error instantiating class. Cause: " + e, e); } } @@ -81,7 +81,7 @@ try { return type.newInstance(); } catch (Exception e) { - throw new BulderException("Error instantiating class. Cause: " + e, e); + throw new BuilderException("Error instantiating class. Cause: " + e, e); } } Copied: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/BuilderException.java (from r780275, ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/BulderException.java) URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/BuilderException.java?p2=ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/BuilderException.java&p1=ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/BulderException.java&r1=780275&r2=781652&rev=781652&view=diff ============================================================================== --- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/BulderException.java (original) +++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/BuilderException.java Thu Jun 4 04:53:14 2009 @@ -2,21 +2,21 @@ import org.apache.ibatis.exceptions.IbatisException; -public class BulderException extends IbatisException { +public class BuilderException extends IbatisException { - public BulderException() { + public BuilderException() { super(); } - public BulderException(String message) { + public BuilderException(String message) { super(message); } - public BulderException(String message, Throwable cause) { + public BuilderException(String message, Throwable cause) { super(message, cause); } - public BulderException(Throwable cause) { + public BuilderException(Throwable cause) { super(cause); } } Modified: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/MapperBuilderAssistant.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/MapperBuilderAssistant.java?rev=781652&r1=781651&r2=781652&view=diff ============================================================================== --- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/MapperBuilderAssistant.java (original) +++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/MapperBuilderAssistant.java Thu Jun 4 04:53:14 2009 @@ -32,7 +32,7 @@ this.currentNamespace = currentNamespace; } if (this.currentNamespace == null) { - throw new BulderException("The mapper element requires a namespace attribute to be specified."); + throw new BuilderException("The mapper element requires a namespace attribute to be specified."); } } @@ -44,11 +44,11 @@ public Cache useCacheRef(String namespace) { if (namespace == null) { - throw new BulderException("cache-ref element requires a namespace attribute."); + throw new BuilderException("cache-ref element requires a namespace attribute."); } Cache cache = configuration.getCache(namespace); if (cache == null) { - throw new BulderException("No cache for namespace '" + namespace + "' could be found."); + throw new BuilderException("No cache for namespace '" + namespace + "' could be found."); } currentCache = cache; return cache; @@ -318,7 +318,7 @@ } } if (javaType == null) { - throw new BulderException("Could not determine javaType for result property " + property + " using javaType " + javaType); + throw new BuilderException("Could not determine javaType for result property " + property + " using javaType " + javaType); } return javaType; } @@ -329,7 +329,7 @@ javaType = metaResultType.getGetterType(property); } if (javaType == null) { - throw new BulderException("Could not determine javaType for result. Specify property or javaType attribute."); + throw new BuilderException("Could not determine javaType for result. Specify property or javaType attribute."); } return javaType; } Modified: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/SqlSourceBuilder.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/SqlSourceBuilder.java?rev=781652&r1=781651&r2=781652&view=diff ============================================================================== --- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/SqlSourceBuilder.java (original) +++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/SqlSourceBuilder.java Thu Jun 4 04:53:14 2009 @@ -71,7 +71,7 @@ builder.typeHandler((TypeHandler) resolveInstance(value)); } } else { - throw new BulderException("Improper inline parameter map format. Should be: #{propName,attr1=val1,attr2=val2}"); + throw new BuilderException("Improper inline parameter map format. Should be: #{propName,attr1=val1,attr2=val2}"); } } return builder.build(); Modified: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/annotation/MapperAnnotationBuilder.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/annotation/MapperAnnotationBuilder.java?rev=781652&r1=781651&r2=781652&view=diff ============================================================================== --- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/annotation/MapperAnnotationBuilder.java (original) +++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/annotation/MapperAnnotationBuilder.java Thu Jun 4 04:53:14 2009 @@ -240,7 +240,7 @@ } return null; } catch (Exception e) { - throw new BulderException("Could not find value method on SQL annotation. Cause: " + e, e); + throw new BuilderException("Could not find value method on SQL annotation. Cause: " + e, e); } } Modified: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/annotation/ProviderSqlSource.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/annotation/ProviderSqlSource.java?rev=781652&r1=781651&r2=781652&view=diff ============================================================================== --- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/annotation/ProviderSqlSource.java (original) +++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/annotation/ProviderSqlSource.java Thu Jun 4 04:53:14 2009 @@ -28,7 +28,7 @@ } } } catch (Exception e) { - throw new BulderException("Error creating SqlSource for SqlProvider. Cause: " + e, e); + throw new BuilderException("Error creating SqlSource for SqlProvider. Cause: " + e, e); } } @@ -48,7 +48,7 @@ Class parameterType = parameterObject == null ? Object.class : parameterObject.getClass(); return sqlSourceParser.parse(sql, parameterType); } catch (Exception e) { - throw new BulderException("Error invoking SqlProvider method (" + throw new BuilderException("Error invoking SqlProvider method (" + providerType.getName() + "." + providerMethod.getName() + "). Cause: " + e, e); } Modified: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/xml/XMLConfigBuilder.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/xml/XMLConfigBuilder.java?rev=781652&r1=781651&r2=781652&view=diff ============================================================================== --- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/xml/XMLConfigBuilder.java (original) +++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/xml/XMLConfigBuilder.java Thu Jun 4 04:53:14 2009 @@ -34,12 +34,12 @@ this.configuration.setVariables(props); this.parsed = false; this.environment = environment; - this.parser = new XPathParser(reader,true, new XMLMapperEntityResolver(),props); + this.parser = new XPathParser(reader, true, new XMLMapperEntityResolver(), props); } public Configuration parse() { if (parsed) { - throw new BulderException("Each MapperConfigParser can only be used once."); + throw new BuilderException("Each MapperConfigParser can only be used once."); } parsed = true; parseConfiguration(parser.evalNode("/configuration")); @@ -57,152 +57,174 @@ typeHandlerElement(root.evalNode("typeHandlers")); mapperElement(root.evalNode("mappers")); } catch (Exception e) { - throw new BulderException("Error parsing SQL Mapper Configuration. Cause: " + e, e); + throw new BuilderException("Error parsing SQL Mapper Configuration. Cause: " + e, e); } } private void typeAliasesElement(XNode parent) { - for (XNode child : parent.getChildren()) { - String alias = child.getStringAttribute("alias"); - String type = child.getStringAttribute("type"); - typeAliasRegistry.registerAlias(alias, type); + if (parent != null) { + for (XNode child : parent.getChildren()) { + String alias = child.getStringAttribute("alias"); + String type = child.getStringAttribute("type"); + typeAliasRegistry.registerAlias(alias, type); + } } } private void pluginElement(XNode parent) throws Exception { - for (XNode child : parent.getChildren()) { - String interceptor = child.getStringAttribute("interceptor"); - Properties properties = child.getChildrenAsProperties(); - Interceptor interceptorInstance = (Interceptor) resolveClass(interceptor).newInstance(); - interceptorInstance.setProperties(properties); - configuration.addInterceptor(interceptorInstance); + if (parent != null) { + for (XNode child : parent.getChildren()) { + String interceptor = child.getStringAttribute("interceptor"); + Properties properties = child.getChildrenAsProperties(); + Interceptor interceptorInstance = (Interceptor) resolveClass(interceptor).newInstance(); + interceptorInstance.setProperties(properties); + configuration.addInterceptor(interceptorInstance); + } } } private void objectFactoryElement(XNode context) throws Exception { - String type = context.getStringAttribute("type"); - Properties properties = context.getChildrenAsProperties(); - ObjectFactory factory = (ObjectFactory) resolveClass(type).newInstance(); - factory.setProperties(properties); - configuration.setObjectFactory(factory); + if (context != null) { + String type = context.getStringAttribute("type"); + Properties properties = context.getChildrenAsProperties(); + ObjectFactory factory = (ObjectFactory) resolveClass(type).newInstance(); + factory.setProperties(properties); + configuration.setObjectFactory(factory); + } } private void propertiesElement(XNode context) throws Exception { - Properties defaults = context.getChildrenAsProperties(); - String resource = context.getStringAttribute("resource"); - String url = context.getStringAttribute("url"); - if (resource != null && url != null) { - throw new BulderException("The properties element cannot specify both a URL and a resource based property file reference. Please specify one or the other."); - } - if (resource != null) { - defaults.putAll(Resources.getResourceAsProperties(resource)); - } else if (url != null) { - defaults.putAll(Resources.getUrlAsProperties(url)); - } - Properties vars = configuration.getVariables(); - if (vars != null) { - defaults.putAll(vars); + if (context != null) { + Properties defaults = context.getChildrenAsProperties(); + String resource = context.getStringAttribute("resource"); + String url = context.getStringAttribute("url"); + if (resource != null && url != null) { + throw new BuilderException("The properties element cannot specify both a URL and a resource based property file reference. Please specify one or the other."); + } + if (resource != null) { + defaults.putAll(Resources.getResourceAsProperties(resource)); + } else if (url != null) { + defaults.putAll(Resources.getUrlAsProperties(url)); + } + Properties vars = configuration.getVariables(); + if (vars != null) { + defaults.putAll(vars); + } + parser.setVariables(defaults); + configuration.setVariables(defaults); } - parser.setVariables(defaults); - configuration.setVariables(defaults); } private void settingsElement(XNode context) throws Exception { - Properties props = context.getChildrenAsProperties(); - // Check that all settings are known to the configuration class - for (Map.Entry entry : props.entrySet()) { - MetaClass metaConfig = MetaClass.forClass(Configuration.class); - if (!metaConfig.hasSetter((String) entry.getKey())) { - throw new BulderException("The setting " + entry.getKey() + " is not known. Make sure you spelled it correctly (case sensitive)."); - } - } - configuration.setCacheEnabled(booleanValueOf(props.getProperty("cacheEnabled"), true)); - configuration.setLazyLoadingEnabled(booleanValueOf(props.getProperty("lazyLoadingEnabled"), true)); - configuration.setMultipleResultSetsEnabled(booleanValueOf(props.getProperty("multipleResultSetsEnabled"), true)); - configuration.setUseColumnLabel(booleanValueOf(props.getProperty("useColumnLabel"), true)); - configuration.setEnhancementEnabled(booleanValueOf(props.getProperty("enhancementEnabled"), false)); - configuration.setUseGeneratedKeys(booleanValueOf(props.getProperty("useGeneratedKeys"), false)); - configuration.setDefaultExecutorType(ExecutorType.valueOf(stringValueOf(props.getProperty("defaultExecutorType"), "SIMPLE"))); - configuration.setDefaultStatementTimeout(integerValueOf(props.getProperty("defaultStatementTimeout"), null)); + if (context != null) { + Properties props = context.getChildrenAsProperties(); + // Check that all settings are known to the configuration class + for (Map.Entry entry : props.entrySet()) { + MetaClass metaConfig = MetaClass.forClass(Configuration.class); + if (!metaConfig.hasSetter((String) entry.getKey())) { + throw new BuilderException("The setting " + entry.getKey() + " is not known. Make sure you spelled it correctly (case sensitive)."); + } + } + configuration.setCacheEnabled(booleanValueOf(props.getProperty("cacheEnabled"), true)); + configuration.setLazyLoadingEnabled(booleanValueOf(props.getProperty("lazyLoadingEnabled"), true)); + configuration.setMultipleResultSetsEnabled(booleanValueOf(props.getProperty("multipleResultSetsEnabled"), true)); + configuration.setUseColumnLabel(booleanValueOf(props.getProperty("useColumnLabel"), true)); + configuration.setEnhancementEnabled(booleanValueOf(props.getProperty("enhancementEnabled"), false)); + configuration.setUseGeneratedKeys(booleanValueOf(props.getProperty("useGeneratedKeys"), false)); + configuration.setDefaultExecutorType(ExecutorType.valueOf(stringValueOf(props.getProperty("defaultExecutorType"), "SIMPLE"))); + configuration.setDefaultStatementTimeout(integerValueOf(props.getProperty("defaultStatementTimeout"), null)); + } } private void environmentsElement(XNode context) throws Exception { - if (environment == null) { - environment = context.getStringAttribute("default"); - } - for (XNode child : context.getChildren()) { - String id = child.getStringAttribute("id"); - if (isSpecifiedEnvironment(id)) { - TransactionFactory txFactory = transactionManagerElement(child.evalNode("transactionManager")); - DataSourceFactory dsFactory = dataSourceElement(child.evalNode("dataSource")); - Environment.Builder environmentBuilder = new Environment.Builder(id, txFactory, dsFactory.getDataSource()); - configuration.setEnvironment(environmentBuilder.build()); + if (context != null) { + if (environment == null) { + environment = context.getStringAttribute("default"); + } + for (XNode child : context.getChildren()) { + String id = child.getStringAttribute("id"); + if (isSpecifiedEnvironment(id)) { + TransactionFactory txFactory = transactionManagerElement(child.evalNode("transactionManager")); + DataSourceFactory dsFactory = dataSourceElement(child.evalNode("dataSource")); + Environment.Builder environmentBuilder = new Environment.Builder(id, txFactory, dsFactory.getDataSource()); + configuration.setEnvironment(environmentBuilder.build()); + } } } } private TransactionFactory transactionManagerElement(XNode context) throws Exception { - String type = context.getStringAttribute("type"); - Properties props = context.getChildrenAsProperties(); - TransactionFactory factory = (TransactionFactory) resolveClass(type).newInstance(); - factory.setProperties(props); - return factory; + if (context != null) { + String type = context.getStringAttribute("type"); + Properties props = context.getChildrenAsProperties(); + TransactionFactory factory = (TransactionFactory) resolveClass(type).newInstance(); + factory.setProperties(props); + return factory; + } + throw new BuilderException("Environment declaration requires a TransactionFactory."); } private DataSourceFactory dataSourceElement(XNode context) throws Exception { - String type = context.getStringAttribute("type"); - Properties props = context.getChildrenAsProperties(); - DataSourceFactory factory = (DataSourceFactory) resolveClass(type).newInstance(); - factory.setProperties(props); - return factory; + if (context != null) { + String type = context.getStringAttribute("type"); + Properties props = context.getChildrenAsProperties(); + DataSourceFactory factory = (DataSourceFactory) resolveClass(type).newInstance(); + factory.setProperties(props); + return factory; + } + throw new BuilderException("Environment declaration requires a DataSourceFactory."); } private void typeHandlerElement(XNode parent) throws Exception { - for (XNode child : parent.getChildren()) { - String javaType = child.getStringAttribute("javaType"); - String jdbcType = child.getStringAttribute("jdbcType"); - String handler = child.getStringAttribute("handler"); - - Class javaTypeClass = resolveClass(javaType); - TypeHandler typeHandlerInstance = (TypeHandler) resolveClass(handler).newInstance(); - - if (jdbcType == null) { - typeHandlerRegistry.register(javaTypeClass, typeHandlerInstance); - } else { - typeHandlerRegistry.register(javaTypeClass, resolveJdbcType(jdbcType), typeHandlerInstance); + if (parent != null) { + for (XNode child : parent.getChildren()) { + String javaType = child.getStringAttribute("javaType"); + String jdbcType = child.getStringAttribute("jdbcType"); + String handler = child.getStringAttribute("handler"); + + Class javaTypeClass = resolveClass(javaType); + TypeHandler typeHandlerInstance = (TypeHandler) resolveClass(handler).newInstance(); + + if (jdbcType == null) { + typeHandlerRegistry.register(javaTypeClass, typeHandlerInstance); + } else { + typeHandlerRegistry.register(javaTypeClass, resolveJdbcType(jdbcType), typeHandlerInstance); + } } } } private void mapperElement(XNode parent) throws Exception { - for (XNode child : parent.getChildren()) { - String resource = child.getStringAttribute("resource"); - String url = child.getStringAttribute("url"); - Reader reader; - if (resource != null && url == null) { - ErrorContext.instance().resource(resource); - reader = Resources.getResourceAsReader(resource); - XMLMapperBuilder mapperParser = new XMLMapperBuilder(reader, configuration, resource); - mapperParser.parse(); - } else if (url != null && resource == null) { - ErrorContext.instance().resource(url); - reader = Resources.getUrlAsReader(url); - XMLMapperBuilder mapperParser = new XMLMapperBuilder(reader, configuration, url); - mapperParser.parse(); - } else { - throw new BulderException("A mapper element may only specify a url or resource, but not both."); + if (parent != null) { + for (XNode child : parent.getChildren()) { + String resource = child.getStringAttribute("resource"); + String url = child.getStringAttribute("url"); + Reader reader; + if (resource != null && url == null) { + ErrorContext.instance().resource(resource); + reader = Resources.getResourceAsReader(resource); + XMLMapperBuilder mapperParser = new XMLMapperBuilder(reader, configuration, resource); + mapperParser.parse(); + } else if (url != null && resource == null) { + ErrorContext.instance().resource(url); + reader = Resources.getUrlAsReader(url); + XMLMapperBuilder mapperParser = new XMLMapperBuilder(reader, configuration, url); + mapperParser.parse(); + } else { + throw new BuilderException("A mapper element may only specify a url or resource, but not both."); + } } } } private boolean isSpecifiedEnvironment(String id) { if (environment == null) { - throw new BulderException("No environment specified."); + throw new BuilderException("No environment specified."); } else if (id == null) { - throw new BulderException("Environment requires an id attribute."); + throw new BuilderException("Environment requires an id attribute."); } else if (environment.equals(id)) { return true; } Modified: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/xml/XMLStatementBuilder.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/xml/XMLStatementBuilder.java?rev=781652&r1=781651&r2=781652&view=diff ============================================================================== --- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/xml/XMLStatementBuilder.java (original) +++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/xml/XMLStatementBuilder.java Thu Jun 4 04:53:14 2009 @@ -5,7 +5,6 @@ import org.apache.ibatis.executor.keygen.*; import org.apache.ibatis.mapping.*; import org.apache.ibatis.parsing.XNode; -import org.apache.ibatis.cache.Cache; import org.w3c.dom.*; import java.util.*; @@ -75,7 +74,7 @@ } else { NodeHandler handler = nodeHandlers.get(nodeName); if (handler == null) { - throw new BulderException("Unknown element <" + nodeName + "> in SQL statement."); + throw new BuilderException("Unknown element <" + nodeName + "> in SQL statement."); } handler.handleNode(child, contents); @@ -148,7 +147,7 @@ String nsrefid = sequentialBuilder.applyCurrentNamespace(refid); includeNode = xmlMapperParser.getSqlFragment(nsrefid); if (includeNode == null) { - throw new BulderException("Could not find SQL statement to include with refid '" + refid + "'"); + throw new BuilderException("Could not find SQL statement to include with refid '" + refid + "'"); } } MixedSqlNode mixedSqlNode = new MixedSqlNode(contents(includeNode)); @@ -248,7 +247,7 @@ if (defaultSqlNodes.size() == 1) { defaultSqlNode = defaultSqlNodes.get(0); } else if (defaultSqlNodes.size() > 1) { - throw new BulderException("Too many default (otherwise) elements in choose statement."); + throw new BuilderException("Too many default (otherwise) elements in choose statement."); } return defaultSqlNode; } Modified: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/xml/dynamic/ExpressionEvaluator.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/xml/dynamic/ExpressionEvaluator.java?rev=781652&r1=781651&r2=781652&view=diff ============================================================================== --- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/xml/dynamic/ExpressionEvaluator.java (original) +++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/xml/dynamic/ExpressionEvaluator.java Thu Jun 4 04:53:14 2009 @@ -1,6 +1,6 @@ package org.apache.ibatis.builder.xml.dynamic; -import org.apache.ibatis.builder.BulderException; +import org.apache.ibatis.builder.BuilderException; import org.apache.ibatis.ognl.*; import java.math.BigDecimal; @@ -15,7 +15,7 @@ if (value instanceof Number) return !new BigDecimal(String.valueOf(value)).equals(BigDecimal.ZERO); return value != null; } catch (OgnlException e) { - throw new BulderException("Error evaluating expression '"+expression+"'. Cause: " + e, e); + throw new BuilderException("Error evaluating expression '"+expression+"'. Cause: " + e, e); } } @@ -24,9 +24,9 @@ Object value = Ognl.getValue(expression, parameterObject); if (value instanceof Iterable) return (Iterable) value; if (value.getClass().isArray()) return Arrays.asList((Object[])value); - throw new BulderException("Error evaluating expression '"+expression+"'. Return value ("+value+") was not iterable."); + throw new BuilderException("Error evaluating expression '"+expression+"'. Return value ("+value+") was not iterable."); } catch (OgnlException e) { - throw new BulderException("Error evaluating expression '"+expression+"'. Cause: " + e, e); + throw new BuilderException("Error evaluating expression '"+expression+"'. Cause: " + e, e); } } Modified: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/xml/ibatis-3-config.dtd URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/xml/ibatis-3-config.dtd?rev=781652&r1=781651&r2=781652&view=diff ============================================================================== --- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/xml/ibatis-3-config.dtd (original) +++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/xml/ibatis-3-config.dtd Thu Jun 4 04:53:14 2009 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8" ?> -<!ELEMENT configuration (properties?, settings?, typeAliases?, typeHandlers?, objectFactory?, plugins?, environments?, mappers)> +<!ELEMENT configuration (properties?, settings?, typeAliases?, typeHandlers?, objectFactory?, plugins?, environments?, mappers?)> <!ELEMENT properties (property*)> <!ATTLIST properties @@ -14,7 +14,7 @@ value CDATA #REQUIRED > -<!ELEMENT settings (setting*)> +<!ELEMENT settings (setting+)> <!ELEMENT setting EMPTY> <!ATTLIST setting @@ -51,7 +51,7 @@ interceptor CDATA #REQUIRED > -<!ELEMENT environments (environment*)> +<!ELEMENT environments (environment+)> <!ATTLIST environments default CDATA #REQUIRED > Modified: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/parsing/XPathParser.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/parsing/XPathParser.java?rev=781652&r1=781651&r2=781652&view=diff ============================================================================== --- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/parsing/XPathParser.java (original) +++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/parsing/XPathParser.java Thu Jun 4 04:53:14 2009 @@ -1,6 +1,6 @@ package org.apache.ibatis.parsing; -import org.apache.ibatis.builder.BulderException; +import org.apache.ibatis.builder.BuilderException; import org.w3c.dom.*; import org.xml.sax.*; @@ -95,7 +95,7 @@ try { return xpath.evaluate(expression, root, returnType); } catch (Exception e) { - throw new BulderException("Error evaluating XPath. Cause: " + e, e); + throw new BuilderException("Error evaluating XPath. Cause: " + e, e); } } @@ -126,7 +126,7 @@ }); return builder.parse(new InputSource(reader)); } catch (Exception e) { - throw new BulderException("Error creating document instance. Cause: " + e, e); + throw new BuilderException("Error creating document instance. Cause: " + e, e); } } Added: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/builder/MinimalMapperConfig.xml URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/builder/MinimalMapperConfig.xml?rev=781652&view=auto ============================================================================== --- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/builder/MinimalMapperConfig.xml (added) +++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/builder/MinimalMapperConfig.xml Thu Jun 4 04:53:14 2009 @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<!DOCTYPE configuration + PUBLIC "-//ibatis.apache.org//DTD Config 3.0//EN" + "http://ibatis.apache.org/dtd/ibatis-3-config.dtd"> + +<configuration> + + +</configuration> + + Added: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/builder/XmlConfigBuilderTest.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/builder/XmlConfigBuilderTest.java?rev=781652&view=auto ============================================================================== --- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/builder/XmlConfigBuilderTest.java (added) +++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/builder/XmlConfigBuilderTest.java Thu Jun 4 04:53:14 2009 @@ -0,0 +1,22 @@ +package org.apache.ibatis.builder; + +import static org.junit.Assert.*; +import org.junit.Test; +import org.apache.ibatis.builder.xml.XMLConfigBuilder; +import org.apache.ibatis.io.Resources; +import org.apache.ibatis.mapping.Configuration; + +import java.io.Reader; + +public class XmlConfigBuilderTest { + + @Test + public void shouldSuccessfullyLoadMinimalXMLConfigFile() throws Exception { + String resource = "org/apache/ibatis/builder/MinimalMapperConfig.xml"; + Reader reader = Resources.getResourceAsReader(resource); + XMLConfigBuilder builder = new XMLConfigBuilder(reader); + Configuration config = builder.parse(); + assertNotNull(config); + } + +} Modified: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/exceptions/GeneralExceptionsTest.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/exceptions/GeneralExceptionsTest.java?rev=781652&r1=781651&r2=781652&view=diff ============================================================================== --- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/exceptions/GeneralExceptionsTest.java (original) +++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/exceptions/GeneralExceptionsTest.java Thu Jun 4 04:53:14 2009 @@ -1,7 +1,7 @@ package org.apache.ibatis.exceptions; import org.apache.ibatis.binding.BindingException; -import org.apache.ibatis.builder.BulderException; +import org.apache.ibatis.builder.BuilderException; import org.apache.ibatis.cache.CacheException; import org.apache.ibatis.datasource.DataSourceException; import org.apache.ibatis.executor.ExecutorException; @@ -41,7 +41,7 @@ LogException.class, MigrationException.class, ParsingException.class, - BulderException.class, + BuilderException.class, PluginException.class, ReflectionException.class, IbatisException.class, From commitsmillerrobert@example.com Fri Jun 05 03:34:07 2009 Return-Path: <commitsmillerrobert@example.com> Delivered-To: millerrobert@example.com Received: (qmail 43134 invoked from network); 5 Jun 2009 03:34:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 5 Jun 2009 03:34:07 -0000 Received: (qmail 55750 invoked by uid 500); 5 Jun 2009 03:34:19 -0000 Delivered-To: millerrobert@example.com Received: (qmail 55712 invoked by uid 500); 5 Jun 2009 03:34:19 -0000 Mailing-List: contact millerrobert@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:millerrobert@example.com> List-Unsubscribe: <mailto:millerrobert@example.com> List-Post: <mailto:millerrobert@example.com> List-Id: <commits.ibatis.apache.org> Reply-To: millerrobert@example.com Delivered-To: mailing list millerrobert@example.com Received: (qmail 55703 invoked by uid 99); 5 Jun 2009 03:34:19 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Jun 2009 03:34:19 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Jun 2009 03:34:15 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 288C2238889C; Fri, 5 Jun 2009 03:33:54 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r781902 - in /ibatis/trunk/java/ibatis-3/ibatis-3-core/src: main/java/org/apache/ibatis/builder/ main/java/org/apache/ibatis/session/defaults/ test/java/org/apache/ibatis/submitted/ test/java/org/apache/ibatis/submitted/integer_enum/ Date: Fri, 05 Jun 2009 03:33:53 -0000 To: millerrobert@example.com From: millerrobert@example.com X-Mailer: svnmailer-1.0.8 Message-Id: <millerrobert@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: cbegin Date: Fri Jun 5 03:33:52 2009 New Revision: 781902 URL: http://svn.apache.org/viewvc?rev=781902&view=rev Log: removed accidental alias resolution on JDBC types Added: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/integer_enum/ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/integer_enum/IntegerEnumTest.java ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/integer_enum/Mapper.xml ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/integer_enum/MapperConfig.xml ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/integer_enum/Record.java Modified: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/BaseBuilder.java ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/session/defaults/DefaultSqlSessionFactory.java Modified: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/BaseBuilder.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/BaseBuilder.java?rev=781902&r1=781901&r2=781902&view=diff ============================================================================== --- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/BaseBuilder.java (original) +++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/builder/BaseBuilder.java Fri Jun 5 03:33:52 2009 @@ -33,7 +33,7 @@ protected JdbcType resolveJdbcType(String alias) { if (alias == null) return null; try { - return JdbcType.valueOf(resolveAlias(alias)); + return JdbcType.valueOf(alias); } catch (IllegalArgumentException e) { throw new BuilderException("Error resolving JdbcType. Cause: " + e, e); } Modified: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/session/defaults/DefaultSqlSessionFactory.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/session/defaults/DefaultSqlSessionFactory.java?rev=781902&r1=781901&r2=781902&view=diff ============================================================================== --- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/session/defaults/DefaultSqlSessionFactory.java (original) +++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/session/defaults/DefaultSqlSessionFactory.java Fri Jun 5 03:33:52 2009 @@ -7,6 +7,7 @@ import org.apache.ibatis.mapping.*; import org.apache.ibatis.session.*; import org.apache.ibatis.transaction.*; +import org.apache.ibatis.transaction.managed.ManagedTransactionFactory; import javax.sql.DataSource; import java.sql.*; @@ -23,8 +24,13 @@ public DefaultSqlSessionFactory(Configuration configuration) { this.configuration = configuration; this.environment = configuration.getEnvironment(); - this.dataSource = environment.getDataSource(); - this.transactionFactory = environment.getTransactionFactory(); + if (environment == null) { + this.dataSource = null; + this.transactionFactory = new ManagedTransactionFactory(); + } else { + this.dataSource = environment.getDataSource(); + this.transactionFactory = environment.getTransactionFactory(); + } } public SqlSession openSession() { @@ -41,6 +47,9 @@ public SqlSession openSession(ExecutorType execType, boolean autoCommit) { try { + if (dataSource == null) { + throw new SessionException("Configuration does not include an environment with a DataSource, so session cannot be created unless a connection is passed in."); + } Connection connection = dataSource.getConnection(); connection = wrapConnection(connection); Transaction tx = transactionFactory.newTransaction(connection, autoCommit); Added: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/integer_enum/IntegerEnumTest.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/integer_enum/IntegerEnumTest.java?rev=781902&view=auto ============================================================================== --- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/integer_enum/IntegerEnumTest.java (added) +++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/integer_enum/IntegerEnumTest.java Fri Jun 5 03:33:52 2009 @@ -0,0 +1,32 @@ +package org.apache.ibatis.submitted.integer_enum; + +import org.apache.ibatis.io.Resources; +import org.apache.ibatis.session.*; +import org.apache.ibatis.BaseDataTest; +import org.junit.Test; +import static org.junit.Assert.*; + +import javax.sql.DataSource; +import java.io.Reader; +import java.sql.Connection; + +public class IntegerEnumTest extends BaseDataTest { + + @Test + public void shouldParseMapWithIntegerJdbcType() throws Exception { + DataSource ds = BaseDataTest.createJPetstoreDataSource(); + Connection conn = ds.getConnection(); + String resource = "org/apache/ibatis/submitted/integer_enum/MapperConfig.xml"; + Reader reader = Resources.getResourceAsReader(resource); + SqlSessionFactoryBuilder builder = new SqlSessionFactoryBuilder(); + SqlSessionFactory sqlMapper = builder.build(reader); + SqlSession session = sqlMapper.openSession(conn); + try { + assertNotNull(session); + } finally { + if (session != null) session.close(); + if (conn != null) conn.close(); + } + } + +} Added: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/integer_enum/Mapper.xml URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/integer_enum/Mapper.xml?rev=781902&view=auto ============================================================================== --- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/integer_enum/Mapper.xml (added) +++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/integer_enum/Mapper.xml Fri Jun 5 03:33:52 2009 @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN" "http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd"> +<mapper namespace="testcase"> + + <resultMap id="tastCaseResultMap" type="org.apache.ibatis.submitted.integer_enum.Record"> + <result jdbcType="INTEGER" column="FIELD1" property="field1"/> + <result jdbcType="INTEGER" column="FIELD2" property="field2"/> + <result jdbcType="VARCHAR" column="FIELD3" property="field3"/> + </resultMap> + + <select id="select" resultMap="tastCaseResultMap"> + select field1, field2, field3 + from SomeTable + </select> + + <update id="update" parameterType="org.apache.ibatis.submitted.integer_enum.Record"> + update SomeTable + set Field2 = #{field2,jdbcType=INTEGER}, + Field3 = #{field3,jdbcType=VARCHAR}, + where field1 = #{field1,jdbcType=INTEGER} + </update> +</mapper> \ No newline at end of file Added: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/integer_enum/MapperConfig.xml URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/integer_enum/MapperConfig.xml?rev=781902&view=auto ============================================================================== --- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/integer_enum/MapperConfig.xml (added) +++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/integer_enum/MapperConfig.xml Fri Jun 5 03:33:52 2009 @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<!DOCTYPE configuration + PUBLIC "-//ibatis.apache.org//DTD Config 3.0//EN" + "http://ibatis.apache.org/dtd/ibatis-3-config.dtd"> +<configuration> + + <mappers> + <mapper resource="org/apache/ibatis/submitted/integer_enum/Mapper.xml"/> + </mappers> + +</configuration> Added: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/integer_enum/Record.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/integer_enum/Record.java?rev=781902&view=auto ============================================================================== --- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/integer_enum/Record.java (added) +++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/integer_enum/Record.java Fri Jun 5 03:33:52
{'source': 'Apache Software Foundation Public Mail Archives'}