ibatis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgbut...@apache.org
Subject svn commit: r833946 - in /ibatis/java/ibator/trunk/core: ./ ibator-core/src/main/java/org/apache/ibatis/ibator/api/ ibator-core/src/main/java/org/apache/ibatis/ibator/api/dom/java/ ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ ibator-co...
Date Sun, 08 Nov 2009 23:34:02 GMT
Author: jgbutler
Date: Sun Nov  8 23:34:01 2009
New Revision: 833946

URL: http://svn.apache.org/viewvc?rev=833946&view=rev
Log:
[ibator] more changes for ibatis3

Modified:
    ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/api/IntrospectedTable.java
    ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/api/dom/java/FullyQualifiedJavaType.java
    ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/AbstractJavaGenerator.java
    ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis2/IntrospectedTableIbatis2Java2Impl.java
    ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/IntrospectedTableIbatis3Impl.java
    ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/javamapper/JavaMapperGenerator.java
    ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/javamapper/elements/CountByExampleMethodGenerator.java
    ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/javamapper/elements/DeleteByPrimaryKeyMethodGenerator.java
    ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/javamapper/elements/SelectByPrimaryKeyMethodGenerator.java
    ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/model/ExampleGenerator.java
    ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/XMLMapperGenerator.java
    ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/AbstractXmlElementGenerator.java
    ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/DeleteByPrimaryKeyElementGenerator.java
    ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/ExampleWhereClauseElementGenerator.java
    ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/InsertSelectiveElementGenerator.java
    ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/SelectByExampleWithBLOBsElementGenerator.java
    ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/SelectByPrimaryKeyElementGenerator.java
    ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/UpdateByExampleSelectiveElementGenerator.java
    ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/UpdateByExampleWithBLOBsElementGenerator.java
    ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/UpdateByExampleWithoutBLOBsElementGenerator.java
    ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/UpdateByPrimaryKeySelectiveElementGenerator.java
    ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/internal/rules/BaseIbatorRules.java
    ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/internal/rules/IbatorRules.java
    ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/internal/rules/IbatorRulesDelegate.java
    ibatis/java/ibator/trunk/core/ibator-core/src/main/resources/org/apache/ibatis/ibator/internal/util/messages/messages.properties
    ibatis/java/ibator/trunk/core/ibator-systests-ibatis3/pom.xml
    ibatis/java/ibator/trunk/core/ibator-systests-ibatis3/src/main/resources/CreateDB.sql
    ibatis/java/ibator/trunk/core/ibator-systests-ibatis3/src/test/java/ibatortest/execute/flat/java5/FlatJava5Test.java
    ibatis/java/ibator/trunk/core/ibator-systests-ibatis3/src/test/java/ibatortest/execute/hierarchical/java5/HierarchicalJava5Test.java
    ibatis/java/ibator/trunk/core/ibator-systests-ibatis3/src/test/java/ibatortest/execute/hierarchical/java5/UpdateByExampleTest.java
    ibatis/java/ibator/trunk/core/pom.xml

Modified: ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/api/IntrospectedTable.java
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/api/IntrospectedTable.java?rev=833946&r1=833945&r2=833946&view=diff
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/api/IntrospectedTable.java (original)
+++ ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/api/IntrospectedTable.java Sun Nov  8 23:34:01 2009
@@ -47,6 +47,11 @@
  *
  */
 public abstract class IntrospectedTable {
+    public enum TargetRuntime {
+        IBATIS2,
+        IBATIS3
+    }
+    
     protected enum InternalAttribute {
         ATTR_DAO_IMPLEMENTATION_TYPE,
         ATTR_DAO_INTERFACE_TYPE,
@@ -59,7 +64,7 @@
         ATTR_IBATIS2_SQL_MAP_NAMESPACE,
         ATTR_IBATIS3_XML_MAPPER_PACKAGE,
         ATTR_IBATIS3_XML_MAPPER_FILE_NAME,
-        ATTR_IBATIS3_JAVA_MAPPER_TYPE, // also used as XML Mapper namespace
+        ATTR_IBATIS3_JAVA_MAPPER_TYPE, // also used as XML Mapper namespace if a DAO mapper is generated
         ATTR_FULLY_QUALIFIED_TABLE_NAME_AT_RUNTIME,
         ATTR_ALIASED_FULLY_QUALIFIED_TABLE_NAME_AT_RUNTIME,
         ATTR_COUNT_BY_EXAMPLE_STATEMENT_ID,
@@ -80,7 +85,8 @@
         ATTR_RESULT_MAP_WITH_BLOBS_ID,
         ATTR_EXAMPLE_WHERE_CLAUSE_ID,
         ATTR_BASE_COLUMN_LIST_ID,
-        ATTR_BLOB_COLUMN_LIST_ID
+        ATTR_BLOB_COLUMN_LIST_ID,
+        ATTR_IBATIS3_UPDATE_BY_EXAMPLE_WHERE_CLAUSE_ID
     }
     
     protected TableConfiguration tableConfiguration;
@@ -90,6 +96,7 @@
     protected List<IntrospectedColumn> primaryKeyColumns;
     protected List<IntrospectedColumn> baseColumns;
     protected List<IntrospectedColumn> blobColumns;
+    protected TargetRuntime targetRuntime;
     
     /**
      * Attributes may be used by plugins to capture table related state
@@ -103,8 +110,9 @@
      */
     protected Map<IntrospectedTable.InternalAttribute, String> internalAttributes;
     
-    public IntrospectedTable() {
+    public IntrospectedTable(TargetRuntime targetRuntime) {
         super();
+        this.targetRuntime = targetRuntime;
         primaryKeyColumns = new ArrayList<IntrospectedColumn>();
         baseColumns = new ArrayList<IntrospectedColumn>();
         blobColumns = new ArrayList<IntrospectedColumn>();
@@ -496,6 +504,7 @@
         setExampleWhereClauseId("Example_Where_Clause"); //$NON-NLS-1$
         setBaseColumnListId("Base_Column_List"); //$NON-NLS-1$
         setBlobColumnListId("Blob_Column_List"); //$NON-NLS-1$
+        setIbatis3UpdateByExampleWhereClauseId("Update_By_Example_Where_Clause"); //$NON-NLS-1$
         applyLegacyXMLPrefix();
     }
     
@@ -618,6 +627,10 @@
         internalAttributes.put(InternalAttribute.ATTR_EXAMPLE_WHERE_CLAUSE_ID, s);
     }
 
+    public void setIbatis3UpdateByExampleWhereClauseId(String s) {
+        internalAttributes.put(InternalAttribute.ATTR_IBATIS3_UPDATE_BY_EXAMPLE_WHERE_CLAUSE_ID, s);
+    }
+
     public void setResultMapWithBLOBsId(String s) {
         internalAttributes.put(InternalAttribute.ATTR_RESULT_MAP_WITH_BLOBS_ID, s);
     }
@@ -694,6 +707,10 @@
         return internalAttributes.get(InternalAttribute.ATTR_EXAMPLE_WHERE_CLAUSE_ID);
     }
 
+    public String getIbatis3UpdateByExampleWhereClauseId() {
+        return internalAttributes.get(InternalAttribute.ATTR_IBATIS3_UPDATE_BY_EXAMPLE_WHERE_CLAUSE_ID);
+    }
+
     public String getResultMapWithBLOBsId() {
         return internalAttributes.get(InternalAttribute.ATTR_RESULT_MAP_WITH_BLOBS_ID);
     }
@@ -1036,4 +1053,8 @@
     public void setIbatis3JavaMapperType(String ibatis3JavaMapperType) {
         internalAttributes.put(InternalAttribute.ATTR_IBATIS3_JAVA_MAPPER_TYPE, ibatis3JavaMapperType);
     }
+
+    public TargetRuntime getTargetRuntime() {
+        return targetRuntime;
+    }
 }

Modified: ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/api/dom/java/FullyQualifiedJavaType.java
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/api/dom/java/FullyQualifiedJavaType.java?rev=833946&r1=833945&r2=833946&view=diff
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/api/dom/java/FullyQualifiedJavaType.java (original)
+++ ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/api/dom/java/FullyQualifiedJavaType.java Sun Nov  8 23:34:01 2009
@@ -84,9 +84,9 @@
             sb.append('?');
             if (boundedWildcard) {
                 if (extendsBoundedWildcard) {
-                    sb.append(" extends ");
+                    sb.append(" extends "); //$NON-NLS-1$
                 } else {
-                    sb.append(" super ");
+                    sb.append(" super "); //$NON-NLS-1$
                 }
                 
                 sb.append(baseQualifiedName);
@@ -157,9 +157,9 @@
             sb.append('?');
             if (boundedWildcard) {
                 if (extendsBoundedWildcard) {
-                    sb.append(" extends ");
+                    sb.append(" extends "); //$NON-NLS-1$
                 } else {
-                    sb.append(" super ");
+                    sb.append(" super "); //$NON-NLS-1$
                 }
                 
                 sb.append(baseShortName);
@@ -321,14 +321,14 @@
     private void parse(String fullTypeSpecification) {
         String spec = fullTypeSpecification.trim();
         
-        if (spec.startsWith("?")) {
+        if (spec.startsWith("?")) { //$NON-NLS-1$
             wildcardType = true;
             spec = spec.substring(1).trim();
-            if (spec.startsWith("extends ")) {
+            if (spec.startsWith("extends ")) { //$NON-NLS-1$
                 boundedWildcard = true;
                 extendsBoundedWildcard = true;
                 spec = spec.substring(8);
-            } else if (spec.startsWith("super ")) {
+            } else if (spec.startsWith("super ")) { //$NON-NLS-1$
                 boundedWildcard = true;
                 extendsBoundedWildcard = false;
                 spec = spec.substring(6);
@@ -349,7 +349,7 @@
     
     private void simpleParse(String typeSpecification) {
         baseQualifiedName = typeSpecification.trim();
-        if (baseQualifiedName.contains(".")) {
+        if (baseQualifiedName.contains(".")) { //$NON-NLS-1$
             packageName = getPackage(baseQualifiedName);
             baseShortName = baseQualifiedName.substring(packageName.length() + 1);
             if ("java.lang".equals(packageName)) { //$NON-NLS-1$
@@ -405,13 +405,13 @@
         StringBuilder sb = new StringBuilder();
         while (st.hasMoreTokens()) {
             String token = st.nextToken();
-            if ("<".equals(token)) {
+            if ("<".equals(token)) { //$NON-NLS-1$
                 sb.append(token);
                 openCount++;
-            } else if (">".equals(token)) {
+            } else if (">".equals(token)) { //$NON-NLS-1$
                 sb.append(token);
                 openCount--;
-            } else if (",".equals(token)) {
+            } else if (",".equals(token)) { //$NON-NLS-1$
                 if (openCount == 0) {
                     typeArguments.add(new FullyQualifiedJavaType(sb.toString()));
                     sb.setLength(0);
@@ -445,7 +445,7 @@
      */
     private static String getPackage(String baseQualifiedName) {
         StringBuilder sb = new StringBuilder();
-        StringTokenizer st = new StringTokenizer(baseQualifiedName, ".");
+        StringTokenizer st = new StringTokenizer(baseQualifiedName, "."); //$NON-NLS-1$
         while (st.hasMoreTokens()) {
             String s = st.nextToken();
             if (Character.isUpperCase(s.charAt(0))) {

Modified: ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/AbstractJavaGenerator.java
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/AbstractJavaGenerator.java?rev=833946&r1=833945&r2=833946&view=diff
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/AbstractJavaGenerator.java (original)
+++ ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/AbstractJavaGenerator.java Sun Nov  8 23:34:01 2009
@@ -43,7 +43,7 @@
         method.setReturnType(field.getType());
         method.setVisibility(JavaVisibility.PUBLIC);
         StringBuilder sb = new StringBuilder();
-        sb.append("return ");
+        sb.append("return "); //$NON-NLS-1$
         sb.append(field.getName());
         sb.append(';');
         method.addBodyLine(sb.toString());

Modified: ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis2/IntrospectedTableIbatis2Java2Impl.java
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis2/IntrospectedTableIbatis2Java2Impl.java?rev=833946&r1=833945&r2=833946&view=diff
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis2/IntrospectedTableIbatis2Java2Impl.java (original)
+++ ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis2/IntrospectedTableIbatis2Java2Impl.java Sun Nov  8 23:34:01 2009
@@ -51,7 +51,7 @@
     protected AbstractXmlGenerator sqlMapGenerator;
 
     public IntrospectedTableIbatis2Java2Impl() {
-        super();
+        super(TargetRuntime.IBATIS2);
         javaModelGenerators = new ArrayList<AbstractJavaGenerator>();
         daoGenerators = new ArrayList<AbstractJavaGenerator>();
     }

Modified: ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/IntrospectedTableIbatis3Impl.java
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/IntrospectedTableIbatis3Impl.java?rev=833946&r1=833945&r2=833946&view=diff
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/IntrospectedTableIbatis3Impl.java (original)
+++ ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/IntrospectedTableIbatis3Impl.java Sun Nov  8 23:34:01 2009
@@ -46,7 +46,7 @@
     protected AbstractXmlGenerator xmlMapperGenerator;
 
     public IntrospectedTableIbatis3Impl() {
-        super();
+        super(TargetRuntime.IBATIS3);
         javaModelGenerators = new ArrayList<AbstractJavaGenerator>();
         daoGenerators = new ArrayList<AbstractJavaGenerator>();
     }

Modified: ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/javamapper/JavaMapperGenerator.java
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/javamapper/JavaMapperGenerator.java?rev=833946&r1=833945&r2=833946&view=diff
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/javamapper/JavaMapperGenerator.java (original)
+++ ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/javamapper/JavaMapperGenerator.java Sun Nov  8 23:34:01 2009
@@ -40,6 +40,7 @@
 import org.apache.ibatis.ibator.generator.ibatis3.javamapper.elements.UpdateByPrimaryKeySelectiveMethodGenerator;
 import org.apache.ibatis.ibator.generator.ibatis3.javamapper.elements.UpdateByPrimaryKeyWithBLOBsMethodGenerator;
 import org.apache.ibatis.ibator.generator.ibatis3.javamapper.elements.UpdateByPrimaryKeyWithoutBLOBsMethodGenerator;
+import org.apache.ibatis.ibator.internal.util.messages.Messages;
 
 /**
  * @author Jeff Butler
@@ -59,7 +60,8 @@
      */
     @Override
     public List<CompilationUnit> getCompilationUnits() {
-        progressCallback.startTask("Generating Mapper class");
+        progressCallback.startTask(Messages.getString("Progress.17", //$NON-NLS-1$
+                introspectedTable.getFullyQualifiedTable().toString()));
         CommentGenerator commentGenerator = ibatorContext.getCommentGenerator();
         
         FullyQualifiedJavaType type = new FullyQualifiedJavaType(introspectedTable.getIbatis3JavaMapperType());

Modified: ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/javamapper/elements/CountByExampleMethodGenerator.java
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/javamapper/elements/CountByExampleMethodGenerator.java?rev=833946&r1=833945&r2=833946&view=diff
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/javamapper/elements/CountByExampleMethodGenerator.java (original)
+++ ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/javamapper/elements/CountByExampleMethodGenerator.java Sun Nov  8 23:34:01 2009
@@ -46,7 +46,7 @@
         method.setVisibility(JavaVisibility.PUBLIC);
         method.setReturnType(FullyQualifiedJavaType.getIntInstance());
         method.setName(introspectedTable.getCountByExampleStatementId());
-        method.addParameter(new Parameter(fqjt, "example"));
+        method.addParameter(new Parameter(fqjt, "example")); //$NON-NLS-1$
         ibatorContext.getCommentGenerator().addGeneralMethodComment(method,
                 introspectedTable);
 

Modified: ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/javamapper/elements/DeleteByPrimaryKeyMethodGenerator.java
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/javamapper/elements/DeleteByPrimaryKeyMethodGenerator.java?rev=833946&r1=833945&r2=833946&view=diff
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/javamapper/elements/DeleteByPrimaryKeyMethodGenerator.java (original)
+++ ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/javamapper/elements/DeleteByPrimaryKeyMethodGenerator.java Sun Nov  8 23:34:01 2009
@@ -15,6 +15,7 @@
  */
 package org.apache.ibatis.ibator.generator.ibatis3.javamapper.elements;
 
+import java.util.List;
 import java.util.Set;
 import java.util.TreeSet;
 
@@ -49,11 +50,28 @@
             importedTypes.add(type);
             method.addParameter(new Parameter(type, "key")); //$NON-NLS-1$
         } else {
-            for (IntrospectedColumn introspectedColumn : introspectedTable.getPrimaryKeyColumns()) {
+            // no primary key class - fields are in the base class
+            // if more than one PK field, then we need to annotate the parameters
+            // for iBATIS3
+            List<IntrospectedColumn> introspectedColumns = introspectedTable.getPrimaryKeyColumns();
+            boolean annotate = introspectedColumns.size() > 1;
+            if (annotate) {
+                importedTypes.add(new FullyQualifiedJavaType("org.apache.ibatis.annotations.Param")); //$NON-NLS-1$
+            }
+            StringBuilder sb = new StringBuilder();
+            for (IntrospectedColumn introspectedColumn : introspectedColumns) {
                 FullyQualifiedJavaType type = introspectedColumn
                         .getFullyQualifiedJavaType();
                 importedTypes.add(type);
-                method.addParameter(new Parameter(type, introspectedColumn.getJavaProperty()));
+                Parameter parameter = new Parameter(type, introspectedColumn.getJavaProperty());
+                if (annotate) {
+                    sb.setLength(0);
+                    sb.append("@Param(\""); //$NON-NLS-1$
+                    sb.append(introspectedColumn.getJavaProperty());
+                    sb.append("\")"); //$NON-NLS-1$
+                    parameter.addAnnotation(sb.toString());
+                }
+                method.addParameter(parameter);
             }
         }
 

Modified: ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/javamapper/elements/SelectByPrimaryKeyMethodGenerator.java
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/javamapper/elements/SelectByPrimaryKeyMethodGenerator.java?rev=833946&r1=833945&r2=833946&view=diff
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/javamapper/elements/SelectByPrimaryKeyMethodGenerator.java (original)
+++ ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/javamapper/elements/SelectByPrimaryKeyMethodGenerator.java Sun Nov  8 23:34:01 2009
@@ -15,6 +15,7 @@
  */
 package org.apache.ibatis.ibator.generator.ibatis3.javamapper.elements;
 
+import java.util.List;
 import java.util.Set;
 import java.util.TreeSet;
 
@@ -56,13 +57,28 @@
             importedTypes.add(type);
             method.addParameter(new Parameter(type, "key")); //$NON-NLS-1$
         } else {
-            for (IntrospectedColumn introspectedColumn : introspectedTable
-                    .getPrimaryKeyColumns()) {
+            // no primary key class - fields are in the base class
+            // if more than one PK field, then we need to annotate the parameters
+            // for iBATIS3
+            List<IntrospectedColumn> introspectedColumns = introspectedTable.getPrimaryKeyColumns();
+            boolean annotate = introspectedColumns.size() > 1;
+            if (annotate) {
+                importedTypes.add(new FullyQualifiedJavaType("org.apache.ibatis.annotations.Param")); //$NON-NLS-1$
+            }
+            StringBuilder sb = new StringBuilder();
+            for (IntrospectedColumn introspectedColumn : introspectedColumns) {
                 FullyQualifiedJavaType type = introspectedColumn
                         .getFullyQualifiedJavaType();
                 importedTypes.add(type);
-                method.addParameter(new Parameter(type, introspectedColumn
-                        .getJavaProperty()));
+                Parameter parameter = new Parameter(type, introspectedColumn.getJavaProperty());
+                if (annotate) {
+                    sb.setLength(0);
+                    sb.append("@Param(\""); //$NON-NLS-1$
+                    sb.append(introspectedColumn.getJavaProperty());
+                    sb.append("\")"); //$NON-NLS-1$
+                    parameter.addAnnotation(sb.toString());
+                }
+                method.addParameter(parameter);
             }
         }
 

Modified: ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/model/ExampleGenerator.java
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/model/ExampleGenerator.java?rev=833946&r1=833945&r2=833946&view=diff
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/model/ExampleGenerator.java (original)
+++ ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/model/ExampleGenerator.java Sun Nov  8 23:34:01 2009
@@ -174,49 +174,49 @@
                 introspectedTable);
         
         field = new Field();
-        field.setName("condition");
+        field.setName("condition"); //$NON-NLS-1$
         field.setType(FullyQualifiedJavaType.getStringInstance());
         field.setVisibility(JavaVisibility.PRIVATE);
         answer.addField(field);
         answer.addMethod(getGetter(field));
 
         field = new Field();
-        field.setName("value");
+        field.setName("value"); //$NON-NLS-1$
         field.setType(FullyQualifiedJavaType.getObjectInstance());
         field.setVisibility(JavaVisibility.PRIVATE);
         answer.addField(field);
         answer.addMethod(getGetter(field));
 
         field = new Field();
-        field.setName("secondValue");
+        field.setName("secondValue"); //$NON-NLS-1$
         field.setType(FullyQualifiedJavaType.getObjectInstance());
         field.setVisibility(JavaVisibility.PRIVATE);
         answer.addField(field);
         answer.addMethod(getGetter(field));
 
         field = new Field();
-        field.setName("noValue");
+        field.setName("noValue"); //$NON-NLS-1$
         field.setType(FullyQualifiedJavaType.getBooleanPrimitiveInstance());
         field.setVisibility(JavaVisibility.PRIVATE);
         answer.addField(field);
         answer.addMethod(getGetter(field));
 
         field = new Field();
-        field.setName("singleValue");
+        field.setName("singleValue"); //$NON-NLS-1$
         field.setType(FullyQualifiedJavaType.getBooleanPrimitiveInstance());
         field.setVisibility(JavaVisibility.PRIVATE);
         answer.addField(field);
         answer.addMethod(getGetter(field));
 
         field = new Field();
-        field.setName("betweenValue");
+        field.setName("betweenValue"); //$NON-NLS-1$
         field.setType(FullyQualifiedJavaType.getBooleanPrimitiveInstance());
         field.setVisibility(JavaVisibility.PRIVATE);
         answer.addField(field);
         answer.addMethod(getGetter(field));
 
         field = new Field();
-        field.setName("listValue");
+        field.setName("listValue"); //$NON-NLS-1$
         field.setType(FullyQualifiedJavaType.getBooleanPrimitiveInstance());
         field.setVisibility(JavaVisibility.PRIVATE);
         answer.addField(field);
@@ -226,7 +226,7 @@
         method.setVisibility(JavaVisibility.PROTECTED);
         method.setName("Criterion"); //$NON-NLS-1$
         method.setConstructor(true);
-        method.addParameter(new Parameter(FullyQualifiedJavaType.getStringInstance(), "condition"));
+        method.addParameter(new Parameter(FullyQualifiedJavaType.getStringInstance(), "condition")); //$NON-NLS-1$
         method.addBodyLine("super();"); //$NON-NLS-1$
         method.addBodyLine("this.condition = condition;"); //$NON-NLS-1$
         method.addBodyLine("this.noValue = true;"); //$NON-NLS-1$
@@ -236,8 +236,8 @@
         method.setVisibility(JavaVisibility.PROTECTED);
         method.setName("Criterion"); //$NON-NLS-1$
         method.setConstructor(true);
-        method.addParameter(new Parameter(FullyQualifiedJavaType.getStringInstance(), "condition"));
-        method.addParameter(new Parameter(FullyQualifiedJavaType.getObjectInstance(), "value"));
+        method.addParameter(new Parameter(FullyQualifiedJavaType.getStringInstance(), "condition")); //$NON-NLS-1$
+        method.addParameter(new Parameter(FullyQualifiedJavaType.getObjectInstance(), "value")); //$NON-NLS-1$
         method.addBodyLine("super();"); //$NON-NLS-1$
         method.addBodyLine("this.condition = condition;"); //$NON-NLS-1$
         method.addBodyLine("this.value = value;"); //$NON-NLS-1$
@@ -252,9 +252,9 @@
         method.setVisibility(JavaVisibility.PROTECTED);
         method.setName("Criterion"); //$NON-NLS-1$
         method.setConstructor(true);
-        method.addParameter(new Parameter(FullyQualifiedJavaType.getStringInstance(), "condition"));
-        method.addParameter(new Parameter(FullyQualifiedJavaType.getObjectInstance(), "value"));
-        method.addParameter(new Parameter(FullyQualifiedJavaType.getObjectInstance(), "secondValue"));
+        method.addParameter(new Parameter(FullyQualifiedJavaType.getStringInstance(), "condition")); //$NON-NLS-1$
+        method.addParameter(new Parameter(FullyQualifiedJavaType.getObjectInstance(), "value")); //$NON-NLS-1$
+        method.addParameter(new Parameter(FullyQualifiedJavaType.getObjectInstance(), "secondValue")); //$NON-NLS-1$
         method.addBodyLine("super();"); //$NON-NLS-1$
         method.addBodyLine("this.condition = condition;"); //$NON-NLS-1$
         method.addBodyLine("this.value = value;"); //$NON-NLS-1$

Modified: ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/XMLMapperGenerator.java
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/XMLMapperGenerator.java?rev=833946&r1=833945&r2=833946&view=diff
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/XMLMapperGenerator.java (original)
+++ ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/XMLMapperGenerator.java Sun Nov  8 23:34:01 2009
@@ -72,6 +72,7 @@
         addResultMapWithoutBLOBsElement(answer);
         addResultMapWithBLOBsElement(answer);
         addExampleWhereClauseElement(answer);
+        addIbatis3UpdateByExampleWhereClauseElement(answer);
         addBaseColumnListElement(answer);
         addBlobColumnListElement(answer);
         addSelectByExampleWithBLOBsElement(answer);
@@ -108,7 +109,14 @@
     
     protected void addExampleWhereClauseElement(XmlElement parentElement) {
         if (introspectedTable.getRules().generateSQLExampleWhereClause()) {
-            AbstractXmlElementGenerator elementGenerator = new ExampleWhereClauseElementGenerator();
+            AbstractXmlElementGenerator elementGenerator = new ExampleWhereClauseElementGenerator(false);
+            initializeAndExecuteGenerator(elementGenerator, parentElement);
+        }
+    }
+    
+    protected void addIbatis3UpdateByExampleWhereClauseElement(XmlElement parentElement) {
+        if (introspectedTable.getRules().generateIbatis3UpdateByExampleWhereClause()) {
+            AbstractXmlElementGenerator elementGenerator = new ExampleWhereClauseElementGenerator(true);
             initializeAndExecuteGenerator(elementGenerator, parentElement);
         }
     }

Modified: ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/AbstractXmlElementGenerator.java
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/AbstractXmlElementGenerator.java?rev=833946&r1=833945&r2=833946&view=diff
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/AbstractXmlElementGenerator.java (original)
+++ ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/AbstractXmlElementGenerator.java Sun Nov  8 23:34:01 2009
@@ -77,7 +77,7 @@
     
     protected XmlElement getExampleIncludeElement() {
         XmlElement ifElement = new XmlElement("if"); //$NON-NLS-1$
-        ifElement.addAttribute(new Attribute("test", "_parameter != null"));
+        ifElement.addAttribute(new Attribute("test", "_parameter != null")); //$NON-NLS-1$ //$NON-NLS-2$
         
         XmlElement includeElement = new XmlElement("include"); //$NON-NLS-1$
         includeElement.addAttribute(new Attribute("refid", //$NON-NLS-1$
@@ -86,4 +86,16 @@
         
         return ifElement;
     }
+    
+    protected XmlElement getUpdateByExampleIncludeElement() {
+        XmlElement ifElement = new XmlElement("if"); //$NON-NLS-1$
+        ifElement.addAttribute(new Attribute("test", "_parameter != null")); //$NON-NLS-1$ //$NON-NLS-2$
+        
+        XmlElement includeElement = new XmlElement("include"); //$NON-NLS-1$
+        includeElement.addAttribute(new Attribute("refid", //$NON-NLS-1$
+                introspectedTable.getIbatis3UpdateByExampleWhereClauseId())); //$NON-NLS-1$
+        ifElement.addElement(includeElement);
+        
+        return ifElement;
+    }
 }

Modified: ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/DeleteByPrimaryKeyElementGenerator.java
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/DeleteByPrimaryKeyElementGenerator.java?rev=833946&r1=833945&r2=833946&view=diff
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/DeleteByPrimaryKeyElementGenerator.java (original)
+++ ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/DeleteByPrimaryKeyElementGenerator.java Sun Nov  8 23:34:01 2009
@@ -42,7 +42,14 @@
         if (introspectedTable.getRules().generatePrimaryKeyClass()) {
             parameterClass = introspectedTable.getPrimaryKeyType();
         } else {
-            parameterClass = introspectedTable.getBaseRecordType();
+            // PK fields are in the base class.  If more than on PK
+            // field, then they are coming in a map.
+            if (introspectedTable.getPrimaryKeyColumns().size() > 1) {
+                parameterClass = "map"; //$NON-NLS-1$
+            } else {
+                parameterClass = introspectedTable.getPrimaryKeyColumns().get(0)
+                    .getFullyQualifiedJavaType().toString();
+            }
         }
         answer.addAttribute(new Attribute("parameterType", //$NON-NLS-1$
                 parameterClass));

Modified: ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/ExampleWhereClauseElementGenerator.java
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/ExampleWhereClauseElementGenerator.java?rev=833946&r1=833945&r2=833946&view=diff
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/ExampleWhereClauseElementGenerator.java (original)
+++ ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/ExampleWhereClauseElementGenerator.java Sun Nov  8 23:34:01 2009
@@ -24,67 +24,50 @@
 /**
  * 
  * @author Jeff Butler
- * 
-<where>
-  <foreach collection="oredCriteria" item="criteria" separator="or">
-    <if test="criteria.valid">
-    (
-      <foreach collection="criteria.criteria" item="criterion" separator="and">
-        <choose>
-          <when test="criterion.noValue">
-            ${criterion.condition}
-          </when>
-          <when test="criterion.singleValue">
-            ${criterion.condition} #{criterion.value}
-          </when>
-          <when test="criterion.betweenValue">
-            ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
-          </when>
-          <when test="criterion.listValue">
-            ${criterion.condition}
-            <foreach collection="criterion.value" item="listItem" open="(" close=")" separator=",">
-              #{listItem}
-            </foreach>
-          </when>
-        </choose>
-      </foreach>
-    )
-    </if>
-  </foreach>
-</where>
  *
  */
 public class ExampleWhereClauseElementGenerator extends AbstractXmlElementGenerator {
 
-    public ExampleWhereClauseElementGenerator() {
+    private boolean isForUpdateByExample;
+    
+    public ExampleWhereClauseElementGenerator(boolean isForUpdateByExample) {
         super();
+        this.isForUpdateByExample = isForUpdateByExample;
     }
 
     @Override
     public void addElements(XmlElement parentElement) {
         XmlElement answer = new XmlElement("sql"); //$NON-NLS-1$
 
-        answer.addAttribute(new Attribute("id", introspectedTable.getExampleWhereClauseId())); //$NON-NLS-1$
+        if (isForUpdateByExample) {
+            answer.addAttribute(new Attribute("id", introspectedTable.getIbatis3UpdateByExampleWhereClauseId())); //$NON-NLS-1$
+        } else {
+            answer.addAttribute(new Attribute("id", introspectedTable.getExampleWhereClauseId())); //$NON-NLS-1$
+        }
 
         ibatorContext.getCommentGenerator().addComment(answer);
 
         XmlElement whereElement = new XmlElement("where"); //$NON-NLS-1$
         answer.addElement(whereElement);
         
-        XmlElement outerForEachElement = new XmlElement("foreach");
-        outerForEachElement.addAttribute(new Attribute("collection", "oredCriteria"));
-        outerForEachElement.addAttribute(new Attribute("item", "criteria"));
-        outerForEachElement.addAttribute(new Attribute("separator", "or"));
+        XmlElement outerForEachElement = new XmlElement("foreach"); //$NON-NLS-1$
+        if (isForUpdateByExample) {
+            outerForEachElement.addAttribute(new Attribute("collection", "example.oredCriteria")); //$NON-NLS-1$ //$NON-NLS-2$
+        } else {
+            outerForEachElement.addAttribute(new Attribute("collection", "oredCriteria")); //$NON-NLS-1$ //$NON-NLS-2$
+        }
+        outerForEachElement.addAttribute(new Attribute("item", "criteria")); //$NON-NLS-1$ //$NON-NLS-2$
+        outerForEachElement.addAttribute(new Attribute("separator", "or")); //$NON-NLS-1$ //$NON-NLS-2$
         whereElement.addElement(outerForEachElement);
         
-        XmlElement ifElement = new XmlElement("if");
-        ifElement.addAttribute(new Attribute("test", "criteria.valid"));
+        XmlElement ifElement = new XmlElement("if"); //$NON-NLS-1$
+        ifElement.addAttribute(new Attribute("test", "criteria.valid")); //$NON-NLS-1$ //$NON-NLS-2$
         outerForEachElement.addElement(ifElement);
         
-        XmlElement trimElement = new XmlElement("trim");
-        trimElement.addAttribute(new Attribute("prefix", "("));
-        trimElement.addAttribute(new Attribute("suffix", ")"));
-        trimElement.addAttribute(new Attribute("prefixOverrides", "and"));
+        XmlElement trimElement = new XmlElement("trim"); //$NON-NLS-1$
+        trimElement.addAttribute(new Attribute("prefix", "(")); //$NON-NLS-1$ //$NON-NLS-2$
+        trimElement.addAttribute(new Attribute("suffix", ")")); //$NON-NLS-1$ //$NON-NLS-2$
+        trimElement.addAttribute(new Attribute("prefixOverrides", "and")); //$NON-NLS-1$ //$NON-NLS-2$
         
         ifElement.addElement(trimElement);
         
@@ -107,7 +90,7 @@
         boolean typeHandled;
         String typeHandlerString;
         if (introspectedColumn == null) {
-            criteriaAttribute = "criteria.criteria";
+            criteriaAttribute = "criteria.criteria"; //$NON-NLS-1$
             typeHandled = false;
             typeHandlerString = null;
         } else {
@@ -120,27 +103,27 @@
             typeHandled = true;
             
             sb.setLength(0);
-            sb.append(",typeHandler=");
+            sb.append(",typeHandler="); //$NON-NLS-1$
             sb.append(introspectedColumn.getTypeHandler());
             typeHandlerString = sb.toString();
         }
         
-        XmlElement middleForEachElement = new XmlElement("foreach");
-        middleForEachElement.addAttribute(new Attribute("collection", criteriaAttribute));
-        middleForEachElement.addAttribute(new Attribute("item", "criterion"));
+        XmlElement middleForEachElement = new XmlElement("foreach"); //$NON-NLS-1$
+        middleForEachElement.addAttribute(new Attribute("collection", criteriaAttribute)); //$NON-NLS-1$
+        middleForEachElement.addAttribute(new Attribute("item", "criterion")); //$NON-NLS-1$ //$NON-NLS-2$
         
-        XmlElement chooseElement = new XmlElement("choose");
+        XmlElement chooseElement = new XmlElement("choose"); //$NON-NLS-1$
         middleForEachElement.addElement(chooseElement);
         
-        XmlElement when = new XmlElement("when");
-        when.addAttribute(new Attribute("test", "criterion.noValue"));
-        when.addElement(new TextElement("and ${criterion.condition}"));
+        XmlElement when = new XmlElement("when"); //$NON-NLS-1$
+        when.addAttribute(new Attribute("test", "criterion.noValue")); //$NON-NLS-1$ //$NON-NLS-2$
+        when.addElement(new TextElement("and ${criterion.condition}")); //$NON-NLS-1$
         chooseElement.addElement(when);
         
-        when = new XmlElement("when");
-        when.addAttribute(new Attribute("test", "criterion.singleValue"));
+        when = new XmlElement("when"); //$NON-NLS-1$
+        when.addAttribute(new Attribute("test", "criterion.singleValue")); //$NON-NLS-1$ //$NON-NLS-2$
         sb.setLength(0);
-        sb.append("and ${criterion.condition} #{criterion.value");
+        sb.append("and ${criterion.condition} #{criterion.value"); //$NON-NLS-1$
         if (typeHandled) {
             sb.append(typeHandlerString);
         }
@@ -148,32 +131,32 @@
         when.addElement(new TextElement(sb.toString()));
         chooseElement.addElement(when);
         
-        when = new XmlElement("when");
-        when.addAttribute(new Attribute("test", "criterion.betweenValue"));
+        when = new XmlElement("when"); //$NON-NLS-1$
+        when.addAttribute(new Attribute("test", "criterion.betweenValue")); //$NON-NLS-1$ //$NON-NLS-2$
         sb.setLength(0);
-        sb.append("and ${criterion.condition} #{criterion.value");
+        sb.append("and ${criterion.condition} #{criterion.value"); //$NON-NLS-1$
         if (typeHandled) {
             sb.append(typeHandlerString);
         }
-        sb.append("} and #{criterion.secondValue");
+        sb.append("} and #{criterion.secondValue"); //$NON-NLS-1$
         if (typeHandled) {
             sb.append(typeHandlerString);
         }
-        sb.append("}");
+        sb.append('}');
         when.addElement(new TextElement(sb.toString()));
         chooseElement.addElement(when);
         
-        when = new XmlElement("when");
-        when.addAttribute(new Attribute("test", "criterion.listValue"));
-        when.addElement(new TextElement("and ${criterion.condition}"));
-        XmlElement innerForEach = new XmlElement("foreach");
-        innerForEach.addAttribute(new Attribute("collection", "criterion.value"));
-        innerForEach.addAttribute(new Attribute("item", "listItem"));
-        innerForEach.addAttribute(new Attribute("open", "("));
-        innerForEach.addAttribute(new Attribute("close", ")"));
-        innerForEach.addAttribute(new Attribute("separator", ","));
+        when = new XmlElement("when"); //$NON-NLS-1$
+        when.addAttribute(new Attribute("test", "criterion.listValue")); //$NON-NLS-1$ //$NON-NLS-2$
+        when.addElement(new TextElement("and ${criterion.condition}")); //$NON-NLS-1$
+        XmlElement innerForEach = new XmlElement("foreach"); //$NON-NLS-1$
+        innerForEach.addAttribute(new Attribute("collection", "criterion.value")); //$NON-NLS-1$ //$NON-NLS-2$
+        innerForEach.addAttribute(new Attribute("item", "listItem")); //$NON-NLS-1$ //$NON-NLS-2$
+        innerForEach.addAttribute(new Attribute("open", "(")); //$NON-NLS-1$ //$NON-NLS-2$
+        innerForEach.addAttribute(new Attribute("close", ")")); //$NON-NLS-1$ //$NON-NLS-2$
+        innerForEach.addAttribute(new Attribute("separator", ",")); //$NON-NLS-1$ //$NON-NLS-2$
         sb.setLength(0);
-        sb.append("#{listItem");
+        sb.append("#{listItem"); //$NON-NLS-1$
         if (typeHandled) {
             sb.append(typeHandlerString);
         }

Modified: ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/InsertSelectiveElementGenerator.java
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/InsertSelectiveElementGenerator.java?rev=833946&r1=833945&r2=833946&view=diff
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/InsertSelectiveElementGenerator.java (original)
+++ ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/InsertSelectiveElementGenerator.java Sun Nov  8 23:34:01 2009
@@ -87,7 +87,7 @@
             XmlElement insertNotNullElement = new XmlElement("if"); //$NON-NLS-1$
             sb.setLength(0);
             sb.append(introspectedColumn.getJavaProperty());
-            sb.append(" != null");
+            sb.append(" != null"); //$NON-NLS-1$
             insertNotNullElement.addAttribute(new Attribute("test", sb.toString())); //$NON-NLS-1$
 
             sb.setLength(0);
@@ -99,7 +99,7 @@
             XmlElement valuesNotNullElement = new XmlElement("if"); //$NON-NLS-1$
             sb.setLength(0);
             sb.append(introspectedColumn.getJavaProperty());
-            sb.append(" != null");
+            sb.append(" != null"); //$NON-NLS-1$
             valuesNotNullElement.addAttribute(new Attribute("test", sb.toString())); //$NON-NLS-1$
             
             sb.setLength(0);

Modified: ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/SelectByExampleWithBLOBsElementGenerator.java
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/SelectByExampleWithBLOBsElementGenerator.java?rev=833946&r1=833945&r2=833946&view=diff
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/SelectByExampleWithBLOBsElementGenerator.java (original)
+++ ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/SelectByExampleWithBLOBsElementGenerator.java Sun Nov  8 23:34:01 2009
@@ -66,7 +66,7 @@
         answer.addElement(getExampleIncludeElement());
 
         XmlElement ifElement = new XmlElement("if"); //$NON-NLS-1$
-        ifElement.addAttribute(new Attribute("test", "orderByClause != null"));
+        ifElement.addAttribute(new Attribute("test", "orderByClause != null")); //$NON-NLS-1$ //$NON-NLS-2$
         ifElement
                 .addElement(new TextElement("order by $orderByClause$")); //$NON-NLS-1$
         answer.addElement(ifElement);

Modified: ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/SelectByPrimaryKeyElementGenerator.java
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/SelectByPrimaryKeyElementGenerator.java?rev=833946&r1=833945&r2=833946&view=diff
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/SelectByPrimaryKeyElementGenerator.java (original)
+++ ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/SelectByPrimaryKeyElementGenerator.java Sun Nov  8 23:34:01 2009
@@ -51,9 +51,14 @@
         if (introspectedTable.getRules().generatePrimaryKeyClass()) {
             parameterType = introspectedTable.getPrimaryKeyType();
         } else {
-            // select by primary key, but no primary key class.  Fields
-            // must be in the base record
-            parameterType = introspectedTable.getBaseRecordType();
+            // PK fields are in the base class.  If more than on PK
+            // field, then they are coming in a map.
+            if (introspectedTable.getPrimaryKeyColumns().size() > 1) {
+                parameterType = "map"; //$NON-NLS-1$
+            } else {
+                parameterType = introspectedTable.getPrimaryKeyColumns().get(0)
+                    .getFullyQualifiedJavaType().toString();
+            }
         }
         
         answer.addAttribute(new Attribute("parameterType", //$NON-NLS-1$

Modified: ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/UpdateByExampleSelectiveElementGenerator.java
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/UpdateByExampleSelectiveElementGenerator.java?rev=833946&r1=833945&r2=833946&view=diff
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/UpdateByExampleSelectiveElementGenerator.java (original)
+++ ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/UpdateByExampleSelectiveElementGenerator.java Sun Nov  8 23:34:01 2009
@@ -69,7 +69,7 @@
             isNotNullElement.addElement(new TextElement(sb.toString()));
         }
 
-        answer.addElement(getExampleIncludeElement());
+        answer.addElement(getUpdateByExampleIncludeElement());
 
         if (ibatorContext.getPlugins().sqlMapUpdateByExampleSelectiveElementGenerated(answer, introspectedTable)) {
             parentElement.addElement(answer);

Modified: ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/UpdateByExampleWithBLOBsElementGenerator.java
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/UpdateByExampleWithBLOBsElementGenerator.java?rev=833946&r1=833945&r2=833946&view=diff
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/UpdateByExampleWithBLOBsElementGenerator.java (original)
+++ ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/UpdateByExampleWithBLOBsElementGenerator.java Sun Nov  8 23:34:01 2009
@@ -76,7 +76,7 @@
             }
         }
         
-        answer.addElement(getExampleIncludeElement());
+        answer.addElement(getUpdateByExampleIncludeElement());
 
         if (ibatorContext.getPlugins().sqlMapUpdateByExampleWithBLOBsElementGenerated(answer, introspectedTable)) {
             parentElement.addElement(answer);

Modified: ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/UpdateByExampleWithoutBLOBsElementGenerator.java
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/UpdateByExampleWithoutBLOBsElementGenerator.java?rev=833946&r1=833945&r2=833946&view=diff
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/UpdateByExampleWithoutBLOBsElementGenerator.java (original)
+++ ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/UpdateByExampleWithoutBLOBsElementGenerator.java Sun Nov  8 23:34:01 2009
@@ -77,7 +77,7 @@
             }
         }
         
-        answer.addElement(getExampleIncludeElement());
+        answer.addElement(getUpdateByExampleIncludeElement());
 
         if (ibatorContext.getPlugins().sqlMapUpdateByExampleWithoutBLOBsElementGenerated(answer, introspectedTable)) {
             parentElement.addElement(answer);

Modified: ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/UpdateByPrimaryKeySelectiveElementGenerator.java
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/UpdateByPrimaryKeySelectiveElementGenerator.java?rev=833946&r1=833945&r2=833946&view=diff
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/UpdateByPrimaryKeySelectiveElementGenerator.java (original)
+++ ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/UpdateByPrimaryKeySelectiveElementGenerator.java Sun Nov  8 23:34:01 2009
@@ -67,7 +67,7 @@
             sb.setLength(0);
             sb.append(introspectedColumn.getJavaProperty());
             sb.append(" != null"); //$NON-NLS-1$
-            isNotNullElement.addAttribute(new Attribute("test", sb.toString()));
+            isNotNullElement.addAttribute(new Attribute("test", sb.toString())); //$NON-NLS-1$
             dynamicElement.addElement(isNotNullElement);
 
             sb.setLength(0);

Modified: ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/internal/rules/BaseIbatorRules.java
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/internal/rules/BaseIbatorRules.java?rev=833946&r1=833945&r2=833946&view=diff
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/internal/rules/BaseIbatorRules.java (original)
+++ ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/internal/rules/BaseIbatorRules.java Sun Nov  8 23:34:01 2009
@@ -16,6 +16,7 @@
 package org.apache.ibatis.ibator.internal.rules;
 
 import org.apache.ibatis.ibator.api.IntrospectedTable;
+import org.apache.ibatis.ibator.api.IntrospectedTable.TargetRuntime;
 import org.apache.ibatis.ibator.api.dom.java.FullyQualifiedJavaType;
 import org.apache.ibatis.ibator.config.TableConfiguration;
 
@@ -192,7 +193,11 @@
     
     /**
      * Implements the rule for generating the SQL example where clause element.
-     * Generate the element if the selectByExample or deleteByExample
+     * 
+     * In iBATIS2, generate the element if the selectByExample, deleteByExample,
+     * updateByExample, or countByExample statements are allowed.
+     * 
+     * In iBATIS3, generate the element if the selectByExample, deleteByExample,
      * or countByExample statements are allowed.
      * 
      * @return true if the SQL where clause element should be generated
@@ -200,13 +205,32 @@
     public boolean generateSQLExampleWhereClause() {
         boolean rc = tableConfiguration.isSelectByExampleStatementEnabled()
             || tableConfiguration.isDeleteByExampleStatementEnabled()
-            || tableConfiguration.isCountByExampleStatementEnabled()
-            || tableConfiguration.isUpdateByExampleStatementEnabled();
+            || tableConfiguration.isCountByExampleStatementEnabled();
+        
+        if (introspectedTable.getTargetRuntime() == TargetRuntime.IBATIS2) {
+            rc |= tableConfiguration.isUpdateByExampleStatementEnabled();
+        }
         
         return rc;
     }
     
     /**
+     * Implements the rule for generating the SQL example where clause element
+     * specifically for use in the update by example methods.
+     * 
+     * In iBATIS2, do not generate the element.
+     * 
+     * In iBATIS3, generate the element if the updateByExample
+     * statements are allowed.
+     * 
+     * @return true if the SQL where clause element should be generated
+     */
+    public boolean generateIbatis3UpdateByExampleWhereClause() {
+        return introspectedTable.getTargetRuntime() == TargetRuntime.IBATIS3
+            && tableConfiguration.isUpdateByExampleStatementEnabled();
+    }
+    
+    /**
      * Implements the rule for generating the select by primary key SQL Map
      * element and DAO method. If the table has a primary key as well as other
      * fields, and the selectByPrimaryKey statement is allowed, then generate

Modified: ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/internal/rules/IbatorRules.java
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/internal/rules/IbatorRules.java?rev=833946&r1=833945&r2=833946&view=diff
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/internal/rules/IbatorRules.java (original)
+++ ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/internal/rules/IbatorRules.java Sun Nov  8 23:34:01 2009
@@ -123,14 +123,31 @@
     
     /**
      * Implements the rule for generating the SQL example where clause element.
-     * Generate the element if the selectByExample, deleteByExample,
+     * 
+     * In iBATIS2, generate the element if the selectByExample, deleteByExample,
      * updateByExample, or countByExample statements are allowed.
      * 
+     * In iBATIS3, generate the element if the selectByExample, deleteByExample,
+     * or countByExample statements are allowed.
+     * 
      * @return true if the SQL where clause element should be generated
      */
     boolean generateSQLExampleWhereClause();
     
     /**
+     * Implements the rule for generating the SQL example where clause element
+     * specifically for use in the update by example methods.
+     * 
+     * In iBATIS2, do not generate the element.
+     * 
+     * In iBATIS3, generate the element if the updateByExample
+     * statements are allowed.
+     * 
+     * @return true if the SQL where clause element should be generated
+     */
+    boolean generateIbatis3UpdateByExampleWhereClause();
+    
+    /**
      * Implements the rule for generating the SQL base column list element.
      * Generate the element if any of the select methods are enabled.
      * 

Modified: ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/internal/rules/IbatorRulesDelegate.java
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/internal/rules/IbatorRulesDelegate.java?rev=833946&r1=833945&r2=833946&view=diff
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/internal/rules/IbatorRulesDelegate.java (original)
+++ ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/internal/rules/IbatorRulesDelegate.java Sun Nov  8 23:34:01 2009
@@ -128,6 +128,10 @@
         return ibatorRules.generateSQLExampleWhereClause();
     }
 
+    public boolean generateIbatis3UpdateByExampleWhereClause() {
+        return ibatorRules.generateIbatis3UpdateByExampleWhereClause();
+    }
+
     public boolean generateUpdateByExampleSelective() {
         return ibatorRules.generateUpdateByExampleSelective();
     }

Modified: ibatis/java/ibator/trunk/core/ibator-core/src/main/resources/org/apache/ibatis/ibator/internal/util/messages/messages.properties
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/src/main/resources/org/apache/ibatis/ibator/internal/util/messages/messages.properties?rev=833946&r1=833945&r2=833946&view=diff
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-core/src/main/resources/org/apache/ibatis/ibator/internal/util/messages/messages.properties (original)
+++ ibatis/java/ibator/trunk/core/ibator-core/src/main/resources/org/apache/ibatis/ibator/internal/util/messages/messages.properties Sun Nov  8 23:34:01 2009
@@ -87,6 +87,7 @@
 Progress.14=Generating DAO Interface and Implementation for table {0}
 Progress.15=Saving file {0}
 Progress.16=Invalid configuration.  Details follow...
+Progress.17=Generating Mapper Interface for table {0}
 
 Tracing.1=Retrieving column information for table "{0}"
 Tracing.2=Found column "{0}", data type {1}, in table "{2}"

Modified: ibatis/java/ibator/trunk/core/ibator-systests-ibatis3/pom.xml
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-systests-ibatis3/pom.xml?rev=833946&r1=833945&r2=833946&view=diff
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-systests-ibatis3/pom.xml (original)
+++ ibatis/java/ibator/trunk/core/ibator-systests-ibatis3/pom.xml Sun Nov  8 23:34:01 2009
@@ -62,20 +62,17 @@
       <version>4.6</version>
       <scope>test</scope>
     </dependency>
+<!--
     <dependency>
     	<groupId>org.apache.ibatis</groupId>
     	<artifactId>ibatis-3-core</artifactId>
     	<version>3.0-SNAPSHOT</version>
     </dependency>
+-->
     <dependency>
-    	<groupId>org.springframework</groupId>
-    	<artifactId>spring-orm</artifactId>
-    	<version>2.5.6</version>
-    </dependency>
-    <dependency>
-    	<groupId>org.springframework</groupId>
-    	<artifactId>spring-jdbc</artifactId>
-    	<version>2.5.6</version>
+    	<groupId>org.apache.ibatis</groupId>
+    	<artifactId>ibatis-sqlmap</artifactId>
+    	<version>3.0-beta-5</version>
     </dependency>
     <dependency>
     	<groupId>org.hsqldb</groupId>

Modified: ibatis/java/ibator/trunk/core/ibator-systests-ibatis3/src/main/resources/CreateDB.sql
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-systests-ibatis3/src/main/resources/CreateDB.sql?rev=833946&r1=833945&r2=833946&view=diff
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-systests-ibatis3/src/main/resources/CreateDB.sql (original)
+++ ibatis/java/ibator/trunk/core/ibator-systests-ibatis3/src/main/resources/CreateDB.sql Sun Nov  8 23:34:01 2009
@@ -6,6 +6,8 @@
 drop table FieldsBlobs if exists;
 drop table "awful table" if exists;
 drop table BlobsOnly if exists;
+drop table RegexRename if exists;
+drop table AnotherAwfulTable if exists;
 
 create table FieldsOnly (
   IntegerField int,

Modified: ibatis/java/ibator/trunk/core/ibator-systests-ibatis3/src/test/java/ibatortest/execute/flat/java5/FlatJava5Test.java
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-systests-ibatis3/src/test/java/ibatortest/execute/flat/java5/FlatJava5Test.java?rev=833946&r1=833945&r2=833946&view=diff
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-systests-ibatis3/src/test/java/ibatortest/execute/flat/java5/FlatJava5Test.java (original)
+++ ibatis/java/ibator/trunk/core/ibator-systests-ibatis3/src/test/java/ibatortest/execute/flat/java5/FlatJava5Test.java Sun Nov  8 23:34:01 2009
@@ -263,18 +263,18 @@
             Pkonly key = new Pkonly();
             key.setId(1);
             key.setSeqNum(3);
-            mapper.insert(key);
+            int rows = mapper.insert(key);
 
             key = new Pkonly();
             key.setId(5);
             key.setSeqNum(6);
-            mapper.insert(key);
+            rows = mapper.insert(key);
 
             PkonlyExample example = new PkonlyExample();
             List<Pkonly> answer = mapper.selectByExample(example);
             assertEquals(2, answer.size());
 
-            int rows = mapper.deleteByPrimaryKey(5, 6);
+            rows = mapper.deleteByPrimaryKey(5, 6);
             assertEquals(1, rows);
 
             answer = mapper.selectByExample(example);
@@ -2010,7 +2010,8 @@
             record.setSecondFirstName("fred2");
             record.setThirdFirstName("fred3");
 
-            Integer generatedCustomerId = mapper.insert(record);
+            mapper.insert(record);
+            Integer generatedCustomerId = record.getCustomerId();
             assertEquals(57, generatedCustomerId.intValue());
 
             AwfulTable returnedRecord = mapper
@@ -2056,7 +2057,8 @@
             record.setSecondFirstName("fred2");
             record.setThirdFirstName("fred3");
 
-            Integer generatedCustomerId = mapper.insertSelective(record);
+            mapper.insertSelective(record);
+            Integer generatedCustomerId = record.getCustomerId();
             assertEquals(57, generatedCustomerId.intValue());
 
             AwfulTable returnedRecord = mapper
@@ -2101,7 +2103,8 @@
             record.setSecondFirstName("fred2");
             record.setThirdFirstName("fred3");
 
-            Integer generatedCustomerId = mapper.insert(record);
+            mapper.insert(record);
+            Integer generatedCustomerId = record.getCustomerId();
 
             record.setId1(11);
             record.setId2(22);
@@ -2151,7 +2154,8 @@
             record.setSecondFirstName("fred2");
             record.setThirdFirstName("fred3");
 
-            Integer generatedCustomerId = mapper.insert(record);
+            mapper.insert(record);
+            Integer generatedCustomerId = record.getCustomerId();
 
             AwfulTable newRecord = new AwfulTable();
             newRecord.setCustomerId(generatedCustomerId);
@@ -2203,7 +2207,8 @@
             record.setSecondFirstName("fred2");
             record.setThirdFirstName("fred3");
 
-            Integer generatedCustomerId = mapper.insert(record);
+            mapper.insert(record);
+            Integer generatedCustomerId = record.getCustomerId();
 
             int rows = mapper.deleteByPrimaryKey(generatedCustomerId);
             assertEquals(1, rows);
@@ -2303,7 +2308,8 @@
             record.setSecondFirstName("fred22");
             record.setThirdFirstName("fred33");
 
-            Integer generatedKey = mapper.insert(record);
+            mapper.insert(record);
+            Integer generatedKey = record.getCustomerId();
 
             AwfulTable returnedRecord = mapper.selectByPrimaryKey(generatedKey);
 

Modified: ibatis/java/ibator/trunk/core/ibator-systests-ibatis3/src/test/java/ibatortest/execute/hierarchical/java5/HierarchicalJava5Test.java
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-systests-ibatis3/src/test/java/ibatortest/execute/hierarchical/java5/HierarchicalJava5Test.java?rev=833946&r1=833945&r2=833946&view=diff
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-systests-ibatis3/src/test/java/ibatortest/execute/hierarchical/java5/HierarchicalJava5Test.java (original)
+++ ibatis/java/ibator/trunk/core/ibator-systests-ibatis3/src/test/java/ibatortest/execute/hierarchical/java5/HierarchicalJava5Test.java Sun Nov  8 23:34:01 2009
@@ -2104,7 +2104,10 @@
             record.setSecondFirstName("fred2");
             record.setThirdFirstName("fred3");
 
-            Integer generatedCustomerId = mapper.insert(record);
+            int count = mapper.insert(record);
+            assertEquals(1, count);
+            
+            Integer generatedCustomerId = record.getCustomerId();
             assertEquals(57, generatedCustomerId.intValue());
 
             AwfulTableKey key = new AwfulTableKey();
@@ -2151,9 +2154,12 @@
             record.setSecondFirstName("fred2");
             record.setThirdFirstName("fred3");
 
-            Integer generatedCustomerId = mapper.insertSelective(record);
+            int count = mapper.insertSelective(record);
+            assertEquals(1, count);
+            
+            Integer generatedCustomerId = record.getCustomerId();
             assertEquals(57, generatedCustomerId.intValue());
-
+            
             AwfulTableKey key = new AwfulTableKey();
             key.setCustomerId(generatedCustomerId);
             AwfulTable returnedRecord = mapper.selectByPrimaryKey(key);
@@ -2197,7 +2203,8 @@
             record.setSecondFirstName("fred2");
             record.setThirdFirstName("fred3");
 
-            Integer generatedCustomerId = mapper.insert(record);
+            mapper.insert(record);
+            Integer generatedCustomerId = record.getCustomerId();
 
             record.setId1(11);
             record.setId2(22);
@@ -2249,7 +2256,8 @@
             record.setSecondFirstName("fred2");
             record.setThirdFirstName("fred3");
 
-            Integer generatedCustomerId = mapper.insert(record);
+            mapper.insert(record);
+            Integer generatedCustomerId = record.getCustomerId();
 
             AwfulTable newRecord = new AwfulTable();
             newRecord.setCustomerId(generatedCustomerId);
@@ -2303,7 +2311,8 @@
             record.setSecondFirstName("fred2");
             record.setThirdFirstName("fred3");
 
-            Integer generatedCustomerId = mapper.insert(record);
+            mapper.insert(record);
+            Integer generatedCustomerId = record.getCustomerId();
 
             AwfulTableKey key = new AwfulTableKey();
             key.setCustomerId(generatedCustomerId);
@@ -2405,7 +2414,8 @@
             record.setSecondFirstName("fred22");
             record.setThirdFirstName("fred33");
 
-            Integer generatedKey = mapper.insert(record);
+            mapper.insert(record);
+            Integer generatedKey = record.getCustomerId();
 
             AwfulTableKey key = new AwfulTableKey();
             key.setCustomerId(generatedKey);

Modified: ibatis/java/ibator/trunk/core/ibator-systests-ibatis3/src/test/java/ibatortest/execute/hierarchical/java5/UpdateByExampleTest.java
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-systests-ibatis3/src/test/java/ibatortest/execute/hierarchical/java5/UpdateByExampleTest.java?rev=833946&r1=833945&r2=833946&view=diff
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-systests-ibatis3/src/test/java/ibatortest/execute/hierarchical/java5/UpdateByExampleTest.java (original)
+++ ibatis/java/ibator/trunk/core/ibator-systests-ibatis3/src/test/java/ibatortest/execute/hierarchical/java5/UpdateByExampleTest.java Sun Nov  8 23:34:01 2009
@@ -445,7 +445,7 @@
             
             PkblobsExample example = new PkblobsExample();
             example.createCriteria().andIdGreaterThan(4);
-            int rows = mapper.updateByExample(newRecord, example);
+            int rows = mapper.updateByExampleWithBLOBs(newRecord, example);
             assertEquals(1, rows);
             
             List<PkblobsWithBLOBs> answer = mapper.selectByExampleWithBLOBs(example);
@@ -581,7 +581,7 @@
             newRecord.setFirstname("Fred");
             PkfieldsblobsExample example = new PkfieldsblobsExample();
             example.createCriteria().andId1EqualTo(3);
-            int rows = mapper.updateByExample(newRecord, example);
+            int rows = mapper.updateByExampleWithBLOBs(newRecord, example);
             assertEquals(1, rows);
     
             List<PkfieldsblobsWithBLOBs> answer = mapper.selectByExampleWithBLOBs(example);
@@ -708,7 +708,7 @@
             newRecord.setLastname("Doe");
             FieldsblobsExample example = new FieldsblobsExample();
             example.createCriteria().andFirstnameLike("S%");
-            int rows = mapper.updateByExample(newRecord, example);
+            int rows = mapper.updateByExampleWithBLOBs(newRecord, example);
             assertEquals(1, rows);
             
             List<FieldsblobsWithBLOBs> answer = mapper.selectByExampleWithBLOBs(example);

Modified: ibatis/java/ibator/trunk/core/pom.xml
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/pom.xml?rev=833946&r1=833945&r2=833946&view=diff
==============================================================================
--- ibatis/java/ibator/trunk/core/pom.xml (original)
+++ ibatis/java/ibator/trunk/core/pom.xml Sun Nov  8 23:34:01 2009
@@ -11,5 +11,6 @@
     <module>ibator-maven-plugin</module>
     <module>ibator-systests-ibatis2-java2</module>
     <module>ibator-systests-ibatis2-java5</module>
+    <module>ibator-systests-ibatis3</module>
   </modules>
 </project>
\ No newline at end of file



Mime
View raw message