ibatis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgbut...@apache.org
Subject svn commit: r679231 [2/2] - in /ibatis/trunk/java/tools/ibator/core: build/ doc/ src/org/apache/ibatis/ibator/api/ src/org/apache/ibatis/ibator/api/dom/ src/org/apache/ibatis/ibator/api/dom/java/ src/org/apache/ibatis/ibator/api/dom/xml/ src/org/apache...
Date Wed, 23 Jul 2008 23:29:11 GMT
Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/plugins/EqualsHashCodePlugin.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/plugins/EqualsHashCodePlugin.java?rev=679231&r1=679230&r2=679231&view=diff
==============================================================================
--- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/plugins/EqualsHashCodePlugin.java
(original)
+++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/plugins/EqualsHashCodePlugin.java
Wed Jul 23 16:29:10 2008
@@ -141,7 +141,7 @@
         method.addBodyLine("return true;"); //$NON-NLS-1$
         method.addBodyLine("}"); //$NON-NLS-1$
 
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append("if (!(that instanceof "); //$NON-NLS-1$
         sb.append(topLevelClass.getType().getShortName());
         sb.append(")) {"); //$NON-NLS-1$
@@ -231,7 +231,7 @@
 
         method.addBodyLine("int hash = 23;"); //$NON-NLS-1$
 
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         boolean valueDeclared = false;
 
         Iterator<ColumnDefinition> iter = columnDefinitions.iterator();

Modified: ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/plugins/SqlMapConfigPlugin.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/plugins/SqlMapConfigPlugin.java?rev=679231&r1=679230&r2=679231&view=diff
==============================================================================
--- ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/plugins/SqlMapConfigPlugin.java
(original)
+++ ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/plugins/SqlMapConfigPlugin.java
Wed Jul 23 16:29:10 2008
@@ -92,7 +92,7 @@
         root.addElement(new TextElement(
             "    to this file before it is usable by iBATIS.")); //$NON-NLS-1$
 
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append("  This file was generated on "); //$NON-NLS-1$
         sb.append(new Date());
         sb.append('.');
@@ -129,7 +129,7 @@
      */
     @Override
     public boolean sqlMapGenerated(GeneratedXmlFile sqlMap, IntrospectedTable introspectedTable)
{
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append(sqlMap.getTargetPackage());
         sb.append('.');
         String temp = sb.toString();

Modified: ibatis/trunk/java/tools/ibator/core/testJava2/ibatortest/java2/CreateDB.sql
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/testJava2/ibatortest/java2/CreateDB.sql?rev=679231&r1=679230&r2=679231&view=diff
==============================================================================
--- ibatis/trunk/java/tools/ibator/core/testJava2/ibatortest/java2/CreateDB.sql (original)
+++ ibatis/trunk/java/tools/ibator/core/testJava2/ibatortest/java2/CreateDB.sql Wed Jul 23
16:29:10 2008
@@ -61,7 +61,7 @@
 create table "awful table" (
   "CuStOmEr iD" int generated by default as identity (start with 57) not null,
   "customer id" int,
-  "first name" varchar(20),
+  "first name" varchar(20) default 'Mabel',
   "First Name" varchar(20),
   "first Name" varchar(20),
   first_name varchar(20),

Modified: ibatis/trunk/java/tools/ibator/core/testJava2/ibatortest/java2/execute/conditional/java2/InsertTests.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/testJava2/ibatortest/java2/execute/conditional/java2/InsertTests.java?rev=679231&r1=679230&r2=679231&view=diff
==============================================================================
--- ibatis/trunk/java/tools/ibator/core/testJava2/ibatortest/java2/execute/conditional/java2/InsertTests.java
(original)
+++ ibatis/trunk/java/tools/ibator/core/testJava2/ibatortest/java2/execute/conditional/java2/InsertTests.java
Wed Jul 23 16:29:10 2008
@@ -255,4 +255,53 @@
             fail(e.getMessage());
         }
     }
+
+    public void testAwfulTableInsertSelective() {
+        AwfulTableDAO dao = getAwfulTableDAO();
+
+        try {
+            AwfulTable record = new AwfulTable();
+
+            record.seteMail("fred@fred.com");
+            record.setEmailaddress("alsofred@fred.com");
+            record.setFourthFirstName("fred4");
+            record.setFrom("from field");
+            record.setId1(new Integer(1));
+            record.setId2(new Integer(2));
+            record.setId5(new Integer(5));
+            record.setId6(new Integer(6));
+            record.setId7(new Integer(7));
+            record.setSecondCustomerId(new Integer(567));
+            record.setSecondFirstName("fred2");
+            record.setThirdFirstName("fred3");
+
+            Integer generatedCustomerId = dao.insertSelective(record);
+            assertEquals(57, generatedCustomerId.intValue());
+
+            AwfulTable returnedRecord = dao
+                    .selectByPrimaryKey(generatedCustomerId);
+
+            assertEquals(generatedCustomerId, returnedRecord.getCustomerId());
+            assertEquals(record.geteMail(), returnedRecord.geteMail());
+            assertEquals(record.getEmailaddress(), returnedRecord
+                    .getEmailaddress());
+            assertEquals("Mabel", returnedRecord.getFirstFirstName());
+            assertEquals(record.getFourthFirstName(), returnedRecord
+                    .getFourthFirstName());
+            assertEquals(record.getFrom(), returnedRecord.getFrom());
+            assertEquals(record.getId1(), returnedRecord.getId1());
+            assertEquals(record.getId2(), returnedRecord.getId2());
+            assertEquals(record.getId5(), returnedRecord.getId5());
+            assertEquals(record.getId6(), returnedRecord.getId6());
+            assertEquals(record.getId7(), returnedRecord.getId7());
+            assertEquals(record.getSecondCustomerId(), returnedRecord
+                    .getSecondCustomerId());
+            assertEquals(record.getSecondFirstName(), returnedRecord
+                    .getSecondFirstName());
+            assertEquals(record.getThirdFirstName(), returnedRecord
+                    .getThirdFirstName());
+        } catch (Exception e) {
+            fail(e.getMessage());
+        }
+    }
 }

Modified: ibatis/trunk/java/tools/ibator/core/testJava2/ibatortest/java2/execute/flat/java2/FlatJava2Tests.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/testJava2/ibatortest/java2/execute/flat/java2/FlatJava2Tests.java?rev=679231&r1=679230&r2=679231&view=diff
==============================================================================
--- ibatis/trunk/java/tools/ibator/core/testJava2/ibatortest/java2/execute/flat/java2/FlatJava2Tests.java
(original)
+++ ibatis/trunk/java/tools/ibator/core/testJava2/ibatortest/java2/execute/flat/java2/FlatJava2Tests.java
Wed Jul 23 16:29:10 2008
@@ -1974,6 +1974,55 @@
         }
     }
 
+    public void testAwfulTableInsertSelective() {
+        AwfulTableDAO dao = getAwfulTableDAO();
+
+        try {
+            AwfulTable record = new AwfulTable();
+
+            record.seteMail("fred@fred.com");
+            record.setEmailaddress("alsofred@fred.com");
+            record.setFourthFirstName("fred4");
+            record.setFrom("from field");
+            record.setId1(new Integer(1));
+            record.setId2(new Integer(2));
+            record.setId5(new Integer(5));
+            record.setId6(new Integer(6));
+            record.setId7(new Integer(7));
+            record.setSecondCustomerId(new Integer(567));
+            record.setSecondFirstName("fred2");
+            record.setThirdFirstName("fred3");
+
+            Integer generatedCustomerId = dao.insertSelective(record);
+            assertEquals(57, generatedCustomerId.intValue());
+
+            AwfulTable returnedRecord = dao
+                    .selectByPrimaryKey(generatedCustomerId);
+
+            assertEquals(generatedCustomerId, returnedRecord.getCustomerId());
+            assertEquals(record.geteMail(), returnedRecord.geteMail());
+            assertEquals(record.getEmailaddress(), returnedRecord
+                    .getEmailaddress());
+            assertEquals("Mabel", returnedRecord.getFirstFirstName());
+            assertEquals(record.getFourthFirstName(), returnedRecord
+                    .getFourthFirstName());
+            assertEquals(record.getFrom(), returnedRecord.getFrom());
+            assertEquals(record.getId1(), returnedRecord.getId1());
+            assertEquals(record.getId2(), returnedRecord.getId2());
+            assertEquals(record.getId5(), returnedRecord.getId5());
+            assertEquals(record.getId6(), returnedRecord.getId6());
+            assertEquals(record.getId7(), returnedRecord.getId7());
+            assertEquals(record.getSecondCustomerId(), returnedRecord
+                    .getSecondCustomerId());
+            assertEquals(record.getSecondFirstName(), returnedRecord
+                    .getSecondFirstName());
+            assertEquals(record.getThirdFirstName(), returnedRecord
+                    .getThirdFirstName());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+    
     public void testAwfulTableUpdateByPrimaryKey() {
         AwfulTableDAO dao = getAwfulTableDAO();
 

Modified: ibatis/trunk/java/tools/ibator/core/testJava2/ibatortest/java2/execute/hierarchical/java2/HierarchicalJava2Tests.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/testJava2/ibatortest/java2/execute/hierarchical/java2/HierarchicalJava2Tests.java?rev=679231&r1=679230&r2=679231&view=diff
==============================================================================
--- ibatis/trunk/java/tools/ibator/core/testJava2/ibatortest/java2/execute/hierarchical/java2/HierarchicalJava2Tests.java
(original)
+++ ibatis/trunk/java/tools/ibator/core/testJava2/ibatortest/java2/execute/hierarchical/java2/HierarchicalJava2Tests.java
Wed Jul 23 16:29:10 2008
@@ -2021,6 +2021,56 @@
         }
     }
 
+    public void testAwfulTableInsertSelective() {
+        AwfulTableDAO dao = getAwfulTableDAO();
+
+        try {
+            AwfulTable record = new AwfulTable();
+
+            record.seteMail("fred@fred.com");
+            record.setEmailaddress("alsofred@fred.com");
+            record.setFourthFirstName("fred4");
+            record.setFrom("from field");
+            record.setId1(new Integer(1));
+            record.setId2(new Integer(2));
+            record.setId5(new Integer(5));
+            record.setId6(new Integer(6));
+            record.setId7(new Integer(7));
+            record.setSecondCustomerId(new Integer(567));
+            record.setSecondFirstName("fred2");
+            record.setThirdFirstName("fred3");
+
+            Integer generatedCustomerId = dao.insertSelective(record);
+            assertEquals(57, generatedCustomerId.intValue());
+
+            AwfulTableKey key = new AwfulTableKey();
+            key.setCustomerId(generatedCustomerId);
+            AwfulTable returnedRecord = dao.selectByPrimaryKey(key);
+
+            assertEquals(generatedCustomerId, returnedRecord.getCustomerId());
+            assertEquals(record.geteMail(), returnedRecord.geteMail());
+            assertEquals(record.getEmailaddress(), returnedRecord
+                    .getEmailaddress());
+            assertEquals("Mabel", returnedRecord.getFirstFirstName());
+            assertEquals(record.getFourthFirstName(), returnedRecord
+                    .getFourthFirstName());
+            assertEquals(record.getFrom(), returnedRecord.getFrom());
+            assertEquals(record.getId1(), returnedRecord.getId1());
+            assertEquals(record.getId2(), returnedRecord.getId2());
+            assertEquals(record.getId5(), returnedRecord.getId5());
+            assertEquals(record.getId6(), returnedRecord.getId6());
+            assertEquals(record.getId7(), returnedRecord.getId7());
+            assertEquals(record.getSecondCustomerId(), returnedRecord
+                    .getSecondCustomerId());
+            assertEquals(record.getSecondFirstName(), returnedRecord
+                    .getSecondFirstName());
+            assertEquals(record.getThirdFirstName(), returnedRecord
+                    .getThirdFirstName());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+    
     public void testAwfulTableUpdateByPrimaryKey() {
         AwfulTableDAO dao = getAwfulTableDAO();
 

Modified: ibatis/trunk/java/tools/ibator/core/testJava5/ibatortest/CreateDB.sql
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/testJava5/ibatortest/CreateDB.sql?rev=679231&r1=679230&r2=679231&view=diff
==============================================================================
--- ibatis/trunk/java/tools/ibator/core/testJava5/ibatortest/CreateDB.sql (original)
+++ ibatis/trunk/java/tools/ibator/core/testJava5/ibatortest/CreateDB.sql Wed Jul 23 16:29:10
2008
@@ -61,7 +61,7 @@
 create table "awful table" (
   "CuStOmEr iD" int generated by default as identity (start with 57) not null,
   "customer id" int,
-  "first name" varchar(20),
+  "first name" varchar(20) default 'Mabel',
   "First Name" varchar(20),
   "first Name" varchar(20),
   first_name varchar(20),

Modified: ibatis/trunk/java/tools/ibator/core/testJava5/ibatortest/execute/conditional/java2/ConditionalJava2Tests.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/testJava5/ibatortest/execute/conditional/java2/ConditionalJava2Tests.java?rev=679231&r1=679230&r2=679231&view=diff
==============================================================================
--- ibatis/trunk/java/tools/ibator/core/testJava5/ibatortest/execute/conditional/java2/ConditionalJava2Tests.java
(original)
+++ ibatis/trunk/java/tools/ibator/core/testJava5/ibatortest/execute/conditional/java2/ConditionalJava2Tests.java
Wed Jul 23 16:29:10 2008
@@ -2002,6 +2002,55 @@
         }
     }
 
+    public void testAwfulTableInsertSelective() {
+        AwfulTableDAO dao = getAwfulTableDAO();
+
+        try {
+            AwfulTable record = new AwfulTable();
+
+            record.seteMail("fred@fred.com");
+            record.setEmailaddress("alsofred@fred.com");
+            record.setFourthFirstName("fred4");
+            record.setFrom("from field");
+            record.setId1(1);
+            record.setId2(2);
+            record.setId5(5);
+            record.setId6(6);
+            record.setId7(7);
+            record.setSecondCustomerId(567);
+            record.setSecondFirstName("fred2");
+            record.setThirdFirstName("fred3");
+
+            Integer generatedCustomerId = dao.insertSelective(record);
+            assertEquals(57, generatedCustomerId.intValue());
+
+            AwfulTable returnedRecord = dao
+                    .selectByPrimaryKey(generatedCustomerId);
+
+            assertEquals(generatedCustomerId, returnedRecord.getCustomerId());
+            assertEquals(record.geteMail(), returnedRecord.geteMail());
+            assertEquals(record.getEmailaddress(), returnedRecord
+                    .getEmailaddress());
+            assertEquals("Mabel", returnedRecord.getFirstFirstName());
+            assertEquals(record.getFourthFirstName(), returnedRecord
+                    .getFourthFirstName());
+            assertEquals(record.getFrom(), returnedRecord.getFrom());
+            assertEquals(record.getId1(), returnedRecord.getId1());
+            assertEquals(record.getId2(), returnedRecord.getId2());
+            assertEquals(record.getId5(), returnedRecord.getId5());
+            assertEquals(record.getId6(), returnedRecord.getId6());
+            assertEquals(record.getId7(), returnedRecord.getId7());
+            assertEquals(record.getSecondCustomerId(), returnedRecord
+                    .getSecondCustomerId());
+            assertEquals(record.getSecondFirstName(), returnedRecord
+                    .getSecondFirstName());
+            assertEquals(record.getThirdFirstName(), returnedRecord
+                    .getThirdFirstName());
+        } catch (Exception e) {
+            fail(e.getMessage());
+        }
+    }
+
     public void testAwfulTableUpdateByPrimaryKey() {
         AwfulTableDAO dao = getAwfulTableDAO();
 

Modified: ibatis/trunk/java/tools/ibator/core/testJava5/ibatortest/execute/conditional/java5/ConditionalJava5Tests.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/testJava5/ibatortest/execute/conditional/java5/ConditionalJava5Tests.java?rev=679231&r1=679230&r2=679231&view=diff
==============================================================================
--- ibatis/trunk/java/tools/ibator/core/testJava5/ibatortest/execute/conditional/java5/ConditionalJava5Tests.java
(original)
+++ ibatis/trunk/java/tools/ibator/core/testJava5/ibatortest/execute/conditional/java5/ConditionalJava5Tests.java
Wed Jul 23 16:29:10 2008
@@ -2007,6 +2007,55 @@
         }
     }
 
+    public void testAwfulTableInsertSelective() {
+        AwfulTableDAO dao = getAwfulTableDAO();
+
+        try {
+            AwfulTable record = new AwfulTable();
+
+            record.seteMail("fred@fred.com");
+            record.setEmailaddress("alsofred@fred.com");
+            record.setFourthFirstName("fred4");
+            record.setFrom("from field");
+            record.setId1(1);
+            record.setId2(2);
+            record.setId5(5);
+            record.setId6(6);
+            record.setId7(7);
+            record.setSecondCustomerId(567);
+            record.setSecondFirstName("fred2");
+            record.setThirdFirstName("fred3");
+
+            Integer generatedCustomerId = dao.insertSelective(record);
+            assertEquals(57, generatedCustomerId.intValue());
+
+            AwfulTable returnedRecord = dao
+                    .selectByPrimaryKey(generatedCustomerId);
+
+            assertEquals(generatedCustomerId, returnedRecord.getCustomerId());
+            assertEquals(record.geteMail(), returnedRecord.geteMail());
+            assertEquals(record.getEmailaddress(), returnedRecord
+                    .getEmailaddress());
+            assertEquals("Mabel", returnedRecord.getFirstFirstName());
+            assertEquals(record.getFourthFirstName(), returnedRecord
+                    .getFourthFirstName());
+            assertEquals(record.getFrom(), returnedRecord.getFrom());
+            assertEquals(record.getId1(), returnedRecord.getId1());
+            assertEquals(record.getId2(), returnedRecord.getId2());
+            assertEquals(record.getId5(), returnedRecord.getId5());
+            assertEquals(record.getId6(), returnedRecord.getId6());
+            assertEquals(record.getId7(), returnedRecord.getId7());
+            assertEquals(record.getSecondCustomerId(), returnedRecord
+                    .getSecondCustomerId());
+            assertEquals(record.getSecondFirstName(), returnedRecord
+                    .getSecondFirstName());
+            assertEquals(record.getThirdFirstName(), returnedRecord
+                    .getThirdFirstName());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+    
     public void testAwfulTableUpdateByPrimaryKey() {
         AwfulTableDAO dao = getAwfulTableDAO();
 

Modified: ibatis/trunk/java/tools/ibator/core/testJava5/ibatortest/execute/flat/java2/FlatJava2Tests.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/testJava5/ibatortest/execute/flat/java2/FlatJava2Tests.java?rev=679231&r1=679230&r2=679231&view=diff
==============================================================================
--- ibatis/trunk/java/tools/ibator/core/testJava5/ibatortest/execute/flat/java2/FlatJava2Tests.java
(original)
+++ ibatis/trunk/java/tools/ibator/core/testJava5/ibatortest/execute/flat/java2/FlatJava2Tests.java
Wed Jul 23 16:29:10 2008
@@ -1960,6 +1960,55 @@
         }
     }
 
+    public void testAwfulTableInsertSelective() {
+        AwfulTableDAO dao = getAwfulTableDAO();
+
+        try {
+            AwfulTable record = new AwfulTable();
+
+            record.seteMail("fred@fred.com");
+            record.setEmailaddress("alsofred@fred.com");
+            record.setFourthFirstName("fred4");
+            record.setFrom("from field");
+            record.setId1(1);
+            record.setId2(2);
+            record.setId5(5);
+            record.setId6(6);
+            record.setId7(7);
+            record.setSecondCustomerId(567);
+            record.setSecondFirstName("fred2");
+            record.setThirdFirstName("fred3");
+
+            Integer generatedCustomerId = dao.insertSelective(record);
+            assertEquals(57, generatedCustomerId.intValue());
+
+            AwfulTable returnedRecord = dao
+                    .selectByPrimaryKey(generatedCustomerId);
+
+            assertEquals(generatedCustomerId, returnedRecord.getCustomerId());
+            assertEquals(record.geteMail(), returnedRecord.geteMail());
+            assertEquals(record.getEmailaddress(), returnedRecord
+                    .getEmailaddress());
+            assertEquals("Mabel", returnedRecord.getFirstFirstName());
+            assertEquals(record.getFourthFirstName(), returnedRecord
+                    .getFourthFirstName());
+            assertEquals(record.getFrom(), returnedRecord.getFrom());
+            assertEquals(record.getId1(), returnedRecord.getId1());
+            assertEquals(record.getId2(), returnedRecord.getId2());
+            assertEquals(record.getId5(), returnedRecord.getId5());
+            assertEquals(record.getId6(), returnedRecord.getId6());
+            assertEquals(record.getId7(), returnedRecord.getId7());
+            assertEquals(record.getSecondCustomerId(), returnedRecord
+                    .getSecondCustomerId());
+            assertEquals(record.getSecondFirstName(), returnedRecord
+                    .getSecondFirstName());
+            assertEquals(record.getThirdFirstName(), returnedRecord
+                    .getThirdFirstName());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+    
     public void testAwfulTableUpdateByPrimaryKey() {
         AwfulTableDAO dao = getAwfulTableDAO();
 

Modified: ibatis/trunk/java/tools/ibator/core/testJava5/ibatortest/execute/flat/java5/FlatJava5Tests.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/testJava5/ibatortest/execute/flat/java5/FlatJava5Tests.java?rev=679231&r1=679230&r2=679231&view=diff
==============================================================================
--- ibatis/trunk/java/tools/ibator/core/testJava5/ibatortest/execute/flat/java5/FlatJava5Tests.java
(original)
+++ ibatis/trunk/java/tools/ibator/core/testJava5/ibatortest/execute/flat/java5/FlatJava5Tests.java
Wed Jul 23 16:29:10 2008
@@ -1935,6 +1935,55 @@
         }
     }
 
+    public void testAwfulTableInsertSelective() {
+        AwfulTableDAO dao = getAwfulTableDAO();
+
+        try {
+            AwfulTable record = new AwfulTable();
+
+            record.seteMail("fred@fred.com");
+            record.setEmailaddress("alsofred@fred.com");
+            record.setFourthFirstName("fred4");
+            record.setFrom("from field");
+            record.setId1(1);
+            record.setId2(2);
+            record.setId5(5);
+            record.setId6(6);
+            record.setId7(7);
+            record.setSecondCustomerId(567);
+            record.setSecondFirstName("fred2");
+            record.setThirdFirstName("fred3");
+
+            Integer generatedCustomerId = dao.insertSelective(record);
+            assertEquals(57, generatedCustomerId.intValue());
+
+            AwfulTable returnedRecord = dao
+                    .selectByPrimaryKey(generatedCustomerId);
+
+            assertEquals(generatedCustomerId, returnedRecord.getCustomerId());
+            assertEquals(record.geteMail(), returnedRecord.geteMail());
+            assertEquals(record.getEmailaddress(), returnedRecord
+                    .getEmailaddress());
+            assertEquals("Mabel", returnedRecord.getFirstFirstName());
+            assertEquals(record.getFourthFirstName(), returnedRecord
+                    .getFourthFirstName());
+            assertEquals(record.getFrom(), returnedRecord.getFrom());
+            assertEquals(record.getId1(), returnedRecord.getId1());
+            assertEquals(record.getId2(), returnedRecord.getId2());
+            assertEquals(record.getId5(), returnedRecord.getId5());
+            assertEquals(record.getId6(), returnedRecord.getId6());
+            assertEquals(record.getId7(), returnedRecord.getId7());
+            assertEquals(record.getSecondCustomerId(), returnedRecord
+                    .getSecondCustomerId());
+            assertEquals(record.getSecondFirstName(), returnedRecord
+                    .getSecondFirstName());
+            assertEquals(record.getThirdFirstName(), returnedRecord
+                    .getThirdFirstName());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+    
     public void testAwfulTableUpdateByPrimaryKey() {
         AwfulTableDAO dao = getAwfulTableDAO();
 

Modified: ibatis/trunk/java/tools/ibator/core/testJava5/ibatortest/execute/hierarchical/java2/HierarchicalJava2Tests.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/testJava5/ibatortest/execute/hierarchical/java2/HierarchicalJava2Tests.java?rev=679231&r1=679230&r2=679231&view=diff
==============================================================================
--- ibatis/trunk/java/tools/ibator/core/testJava5/ibatortest/execute/hierarchical/java2/HierarchicalJava2Tests.java
(original)
+++ ibatis/trunk/java/tools/ibator/core/testJava5/ibatortest/execute/hierarchical/java2/HierarchicalJava2Tests.java
Wed Jul 23 16:29:10 2008
@@ -2020,6 +2020,56 @@
         }
     }
 
+    public void testAwfulTableInsertSelective() {
+        AwfulTableDAO dao = getAwfulTableDAO();
+
+        try {
+            AwfulTable record = new AwfulTable();
+
+            record.seteMail("fred@fred.com");
+            record.setEmailaddress("alsofred@fred.com");
+            record.setFourthFirstName("fred4");
+            record.setFrom("from field");
+            record.setId1(1);
+            record.setId2(2);
+            record.setId5(5);
+            record.setId6(6);
+            record.setId7(7);
+            record.setSecondCustomerId(567);
+            record.setSecondFirstName("fred2");
+            record.setThirdFirstName("fred3");
+
+            Integer generatedCustomerId = dao.insertSelective(record);
+            assertEquals(57, generatedCustomerId.intValue());
+
+            AwfulTableKey key = new AwfulTableKey();
+            key.setCustomerId(generatedCustomerId);
+            AwfulTable returnedRecord = dao.selectByPrimaryKey(key);
+
+            assertEquals(generatedCustomerId, returnedRecord.getCustomerId());
+            assertEquals(record.geteMail(), returnedRecord.geteMail());
+            assertEquals(record.getEmailaddress(), returnedRecord
+                    .getEmailaddress());
+            assertEquals("Mabel", returnedRecord.getFirstFirstName());
+            assertEquals(record.getFourthFirstName(), returnedRecord
+                    .getFourthFirstName());
+            assertEquals(record.getFrom(), returnedRecord.getFrom());
+            assertEquals(record.getId1(), returnedRecord.getId1());
+            assertEquals(record.getId2(), returnedRecord.getId2());
+            assertEquals(record.getId5(), returnedRecord.getId5());
+            assertEquals(record.getId6(), returnedRecord.getId6());
+            assertEquals(record.getId7(), returnedRecord.getId7());
+            assertEquals(record.getSecondCustomerId(), returnedRecord
+                    .getSecondCustomerId());
+            assertEquals(record.getSecondFirstName(), returnedRecord
+                    .getSecondFirstName());
+            assertEquals(record.getThirdFirstName(), returnedRecord
+                    .getThirdFirstName());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+    
     public void testAwfulTableUpdateByPrimaryKey() {
         AwfulTableDAO dao = getAwfulTableDAO();
 

Modified: ibatis/trunk/java/tools/ibator/core/testJava5/ibatortest/execute/hierarchical/java5/HierarchicalJava5Tests.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/testJava5/ibatortest/execute/hierarchical/java5/HierarchicalJava5Tests.java?rev=679231&r1=679230&r2=679231&view=diff
==============================================================================
--- ibatis/trunk/java/tools/ibator/core/testJava5/ibatortest/execute/hierarchical/java5/HierarchicalJava5Tests.java
(original)
+++ ibatis/trunk/java/tools/ibator/core/testJava5/ibatortest/execute/hierarchical/java5/HierarchicalJava5Tests.java
Wed Jul 23 16:29:10 2008
@@ -2024,6 +2024,56 @@
         }
     }
 
+    public void testAwfulTableInsertSelective() {
+        AwfulTableDAO dao = getAwfulTableDAO();
+
+        try {
+            AwfulTable record = new AwfulTable();
+
+            record.seteMail("fred@fred.com");
+            record.setEmailaddress("alsofred@fred.com");
+            record.setFourthFirstName("fred4");
+            record.setFrom("from field");
+            record.setId1(1);
+            record.setId2(2);
+            record.setId5(5);
+            record.setId6(6);
+            record.setId7(7);
+            record.setSecondCustomerId(567);
+            record.setSecondFirstName("fred2");
+            record.setThirdFirstName("fred3");
+
+            Integer generatedCustomerId = dao.insertSelective(record);
+            assertEquals(57, generatedCustomerId.intValue());
+
+            AwfulTableKey key = new AwfulTableKey();
+            key.setCustomerId(generatedCustomerId);
+            AwfulTable returnedRecord = dao.selectByPrimaryKey(key);
+
+            assertEquals(generatedCustomerId, returnedRecord.getCustomerId());
+            assertEquals(record.geteMail(), returnedRecord.geteMail());
+            assertEquals(record.getEmailaddress(), returnedRecord
+                    .getEmailaddress());
+            assertEquals("Mabel", returnedRecord.getFirstFirstName());
+            assertEquals(record.getFourthFirstName(), returnedRecord
+                    .getFourthFirstName());
+            assertEquals(record.getFrom(), returnedRecord.getFrom());
+            assertEquals(record.getId1(), returnedRecord.getId1());
+            assertEquals(record.getId2(), returnedRecord.getId2());
+            assertEquals(record.getId5(), returnedRecord.getId5());
+            assertEquals(record.getId6(), returnedRecord.getId6());
+            assertEquals(record.getId7(), returnedRecord.getId7());
+            assertEquals(record.getSecondCustomerId(), returnedRecord
+                    .getSecondCustomerId());
+            assertEquals(record.getSecondFirstName(), returnedRecord
+                    .getSecondFirstName());
+            assertEquals(record.getThirdFirstName(), returnedRecord
+                    .getThirdFirstName());
+        } catch (Exception e) {
+            fail(e.getMessage());
+        }
+    }
+    
     public void testAwfulTableUpdateByPrimaryKey() {
         AwfulTableDAO dao = getAwfulTableDAO();
 



Mime
View raw message