ibatis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgbut...@apache.org
Subject svn commit: r833772 [17/25] - in /ibatis/java/ibator/trunk/core: ./ ibator-core/doc/ ibator-core/doc/html/ ibator-core/doc/html/configreference/ ibator-core/doc/html/generatedobjects/ ibator-core/doc/html/reference/ ibator-core/doc/html/usage/ ibator-m...
Date Sat, 07 Nov 2009 22:59:05 GMT
Added: ibatis/java/ibator/trunk/core/ibator-systests-ibatis2-java5/src/test/java/ibatortest/execute/flat/java2/FlatJava2Test.java
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-systests-ibatis2-java5/src/test/java/ibatortest/execute/flat/java2/FlatJava2Test.java?rev=833772&view=auto
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-systests-ibatis2-java5/src/test/java/ibatortest/execute/flat/java2/FlatJava2Test.java (added)
+++ ibatis/java/ibator/trunk/core/ibator-systests-ibatis2-java5/src/test/java/ibatortest/execute/flat/java2/FlatJava2Test.java Sat Nov  7 22:59:00 2009
@@ -0,0 +1,3077 @@
+/*
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package ibatortest.execute.flat.java2;
+
+import ibatortest.generated.flat.java2.dao.AwfulTableDAO;
+import ibatortest.generated.flat.java2.dao.FieldsblobsDAO;
+import ibatortest.generated.flat.java2.dao.FieldsonlyDAO;
+import ibatortest.generated.flat.java2.dao.PkblobsDAO;
+import ibatortest.generated.flat.java2.dao.PkfieldsDAO;
+import ibatortest.generated.flat.java2.dao.PkfieldsblobsDAO;
+import ibatortest.generated.flat.java2.dao.PkonlyDAO;
+import ibatortest.generated.flat.java2.model.AwfulTable;
+import ibatortest.generated.flat.java2.model.AwfulTableExample;
+import ibatortest.generated.flat.java2.model.Fieldsblobs;
+import ibatortest.generated.flat.java2.model.FieldsblobsExample;
+import ibatortest.generated.flat.java2.model.Fieldsonly;
+import ibatortest.generated.flat.java2.model.FieldsonlyExample;
+import ibatortest.generated.flat.java2.model.Pkblobs;
+import ibatortest.generated.flat.java2.model.PkblobsExample;
+import ibatortest.generated.flat.java2.model.Pkfields;
+import ibatortest.generated.flat.java2.model.PkfieldsExample;
+import ibatortest.generated.flat.java2.model.Pkfieldsblobs;
+import ibatortest.generated.flat.java2.model.PkfieldsblobsExample;
+import ibatortest.generated.flat.java2.model.Pkonly;
+import ibatortest.generated.flat.java2.model.PkonlyExample;
+
+import java.math.BigDecimal;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author Jeff Butler
+ * 
+ */
+public class FlatJava2Test extends AbstractFlatJava2Test {
+
+    @SuppressWarnings("unchecked")
+    public void testFieldsOnlyInsert() {
+        FieldsonlyDAO dao = getFieldsonlyDAO();
+
+        try {
+            Fieldsonly record = new Fieldsonly();
+            record.setDoublefield(11.22);
+            record.setFloatfield(33.44);
+            record.setIntegerfield(5);
+            dao.insert(record);
+
+            FieldsonlyExample example = new FieldsonlyExample();
+            example.createCriteria().andIntegerfieldEqualTo(5);
+
+            List answer = dao.selectByExample(example);
+            assertEquals(1, answer.size());
+
+            Fieldsonly returnedRecord = (Fieldsonly) answer.get(0);
+            assertEquals(record.getIntegerfield(), returnedRecord
+                    .getIntegerfield());
+            assertEquals(record.getDoublefield(), returnedRecord
+                    .getDoublefield());
+            assertEquals(record.getFloatfield(), returnedRecord.getFloatfield());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testFieldsOnlySelectByExample() {
+        FieldsonlyDAO dao = getFieldsonlyDAO();
+
+        try {
+            Fieldsonly record = new Fieldsonly();
+            record.setDoublefield(11.22);
+            record.setFloatfield(33.44);
+            record.setIntegerfield(5);
+            dao.insert(record);
+
+            record = new Fieldsonly();
+            record.setDoublefield(44.55);
+            record.setFloatfield(66.77);
+            record.setIntegerfield(8);
+            dao.insert(record);
+
+            record = new Fieldsonly();
+            record.setDoublefield(88.99);
+            record.setFloatfield(100.111);
+            record.setIntegerfield(9);
+            dao.insert(record);
+
+            FieldsonlyExample example = new FieldsonlyExample();
+            example.createCriteria().andIntegerfieldGreaterThan(5);
+
+            List answer = dao.selectByExample(example);
+            assertEquals(2, answer.size());
+
+            example = new FieldsonlyExample();
+            answer = dao.selectByExample(example);
+            assertEquals(3, answer.size());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testFieldsOnlySelectByExampleNoCriteria() {
+        FieldsonlyDAO dao = getFieldsonlyDAO();
+
+        try {
+            Fieldsonly record = new Fieldsonly();
+            record.setDoublefield(11.22);
+            record.setFloatfield(33.44);
+            record.setIntegerfield(5);
+            dao.insert(record);
+
+            record = new Fieldsonly();
+            record.setDoublefield(44.55);
+            record.setFloatfield(66.77);
+            record.setIntegerfield(8);
+            dao.insert(record);
+
+            record = new Fieldsonly();
+            record.setDoublefield(88.99);
+            record.setFloatfield(100.111);
+            record.setIntegerfield(9);
+            dao.insert(record);
+
+            FieldsonlyExample example = new FieldsonlyExample();
+            example.createCriteria();
+
+            List answer = dao.selectByExample(example);
+            assertEquals(3, answer.size());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testFieldsOnlyDeleteByExample() {
+        FieldsonlyDAO dao = getFieldsonlyDAO();
+
+        try {
+            Fieldsonly record = new Fieldsonly();
+            record.setDoublefield(11.22);
+            record.setFloatfield(33.44);
+            record.setIntegerfield(5);
+            dao.insert(record);
+
+            record = new Fieldsonly();
+            record.setDoublefield(44.55);
+            record.setFloatfield(66.77);
+            record.setIntegerfield(8);
+            dao.insert(record);
+
+            record = new Fieldsonly();
+            record.setDoublefield(88.99);
+            record.setFloatfield(100.111);
+            record.setIntegerfield(9);
+            dao.insert(record);
+
+            FieldsonlyExample example = new FieldsonlyExample();
+            example.createCriteria().andIntegerfieldGreaterThan(5);
+
+            int rows = dao.deleteByExample(example);
+            assertEquals(2, rows);
+
+            example = new FieldsonlyExample();
+            List answer = dao.selectByExample(example);
+            assertEquals(1, answer.size());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    public void testFieldsOnlyCountByExample() {
+        FieldsonlyDAO dao = getFieldsonlyDAO();
+
+        try {
+            Fieldsonly record = new Fieldsonly();
+            record.setDoublefield(11.22);
+            record.setFloatfield(33.44);
+            record.setIntegerfield(5);
+            dao.insert(record);
+
+            record = new Fieldsonly();
+            record.setDoublefield(44.55);
+            record.setFloatfield(66.77);
+            record.setIntegerfield(8);
+            dao.insert(record);
+
+            record = new Fieldsonly();
+            record.setDoublefield(88.99);
+            record.setFloatfield(100.111);
+            record.setIntegerfield(9);
+            dao.insert(record);
+
+            FieldsonlyExample example = new FieldsonlyExample();
+            example.createCriteria().andIntegerfieldGreaterThan(5);
+
+            int rows = dao.countByExample(example);
+            assertEquals(2, rows);
+
+            example.clear();
+            rows = dao.countByExample(example);
+            assertEquals(3, rows);
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testPKOnlyInsert() {
+        PkonlyDAO dao = getPkonlyDAO();
+
+        try {
+            Pkonly key = new Pkonly();
+            key.setId(1);
+            key.setSeqNum(3);
+            dao.insert(key);
+
+            PkonlyExample example = new PkonlyExample();
+            List answer = dao.selectByExample(example);
+            assertEquals(1, answer.size());
+
+            Pkonly returnedRecord = (Pkonly) answer.get(0);
+            assertEquals(key.getId(), returnedRecord.getId());
+            assertEquals(key.getSeqNum(), returnedRecord.getSeqNum());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testPKOnlyDeleteByPrimaryKey() {
+        PkonlyDAO dao = getPkonlyDAO();
+
+        try {
+            Pkonly key = new Pkonly();
+            key.setId(1);
+            key.setSeqNum(3);
+            dao.insert(key);
+
+            key = new Pkonly();
+            key.setId(5);
+            key.setSeqNum(6);
+            dao.insert(key);
+
+            PkonlyExample example = new PkonlyExample();
+            List answer = dao.selectByExample(example);
+            assertEquals(2, answer.size());
+
+            int rows = dao.deleteByPrimaryKey(5, 6);
+            assertEquals(1, rows);
+
+            answer = dao.selectByExample(example);
+            assertEquals(1, answer.size());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testPKOnlyDeleteByExample() {
+        PkonlyDAO dao = getPkonlyDAO();
+
+        try {
+            Pkonly key = new Pkonly();
+            key.setId(1);
+            key.setSeqNum(3);
+            dao.insert(key);
+
+            key = new Pkonly();
+            key.setId(5);
+            key.setSeqNum(6);
+            dao.insert(key);
+
+            key = new Pkonly();
+            key.setId(7);
+            key.setSeqNum(8);
+            dao.insert(key);
+
+            PkonlyExample example = new PkonlyExample();
+            example.createCriteria().andIdGreaterThan(4);
+            int rows = dao.deleteByExample(example);
+            assertEquals(2, rows);
+
+            example = new PkonlyExample();
+            List answer = dao.selectByExample(example);
+            assertEquals(1, answer.size());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testPKOnlySelectByExample() {
+        PkonlyDAO dao = getPkonlyDAO();
+
+        try {
+            Pkonly key = new Pkonly();
+            key.setId(1);
+            key.setSeqNum(3);
+            dao.insert(key);
+
+            key = new Pkonly();
+            key.setId(5);
+            key.setSeqNum(6);
+            dao.insert(key);
+
+            key = new Pkonly();
+            key.setId(7);
+            key.setSeqNum(8);
+            dao.insert(key);
+
+            PkonlyExample example = new PkonlyExample();
+            example.createCriteria().andIdGreaterThan(4);
+            List answer = dao.selectByExample(example);
+            assertEquals(2, answer.size());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testPKOnlySelectByExampleNoCriteria() {
+        PkonlyDAO dao = getPkonlyDAO();
+
+        try {
+            Pkonly key = new Pkonly();
+            key.setId(1);
+            key.setSeqNum(3);
+            dao.insert(key);
+
+            key = new Pkonly();
+            key.setId(5);
+            key.setSeqNum(6);
+            dao.insert(key);
+
+            key = new Pkonly();
+            key.setId(7);
+            key.setSeqNum(8);
+            dao.insert(key);
+
+            PkonlyExample example = new PkonlyExample();
+            example.createCriteria();
+            List answer = dao.selectByExample(example);
+            assertEquals(3, answer.size());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    public void testPKOnlyCountByExample() {
+        PkonlyDAO dao = getPkonlyDAO();
+
+        try {
+            Pkonly key = new Pkonly();
+            key.setId(1);
+            key.setSeqNum(3);
+            dao.insert(key);
+
+            key = new Pkonly();
+            key.setId(5);
+            key.setSeqNum(6);
+            dao.insert(key);
+
+            key = new Pkonly();
+            key.setId(7);
+            key.setSeqNum(8);
+            dao.insert(key);
+
+            PkonlyExample example = new PkonlyExample();
+            example.createCriteria().andIdGreaterThan(4);
+            int rows = dao.countByExample(example);
+            assertEquals(2, rows);
+
+            example.clear();
+            rows = dao.countByExample(example);
+            assertEquals(3, rows);
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    public void testPKFieldsInsert() {
+        PkfieldsDAO dao = getPkfieldsDAO();
+
+        try {
+            Pkfields record = new Pkfields();
+            record.setDatefield(new Date());
+            record.setDecimal100field(10L);
+            record.setDecimal155field(new BigDecimal("15.12345"));
+            record.setDecimal30field((short) 3);
+            record.setDecimal60field(6);
+            record.setFirstname("Jeff");
+            record.setId1(1);
+            record.setId2(2);
+            record.setLastname("Butler");
+            record.setTimefield(new Date());
+            record.setTimestampfield(new Date());
+
+            dao.insert(record);
+
+            Pkfields returnedRecord = dao.selectByPrimaryKey(1, 2);
+            assertNotNull(returnedRecord);
+
+            assertTrue(datesAreEqual(record.getDatefield(), returnedRecord
+                    .getDatefield()));
+            assertEquals(record.getDecimal100field(), returnedRecord
+                    .getDecimal100field());
+            assertEquals(record.getDecimal155field(), returnedRecord
+                    .getDecimal155field());
+            assertEquals(record.getDecimal30field(), returnedRecord
+                    .getDecimal30field());
+            assertEquals(record.getDecimal60field(), returnedRecord
+                    .getDecimal60field());
+            assertEquals(record.getFirstname(), returnedRecord.getFirstname());
+            assertEquals(record.getId1(), returnedRecord.getId1());
+            assertEquals(record.getId2(), returnedRecord.getId2());
+            assertEquals(record.getLastname(), returnedRecord.getLastname());
+            assertTrue(timesAreEqual(record.getTimefield(), returnedRecord
+                    .getTimefield()));
+            assertEquals(record.getTimestampfield(), returnedRecord
+                    .getTimestampfield());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    public void testPKFieldsUpdateByPrimaryKey() {
+        PkfieldsDAO dao = getPkfieldsDAO();
+
+        try {
+            Pkfields record = new Pkfields();
+            record.setFirstname("Jeff");
+            record.setLastname("Smith");
+            record.setId1(1);
+            record.setId2(2);
+
+            dao.insert(record);
+
+            record.setFirstname("Scott");
+            record.setLastname("Jones");
+
+            int rows = dao.updateByPrimaryKey(record);
+            assertEquals(1, rows);
+
+            Pkfields record2 = dao.selectByPrimaryKey(1, 2);
+
+            assertEquals(record.getFirstname(), record2.getFirstname());
+            assertEquals(record.getLastname(), record2.getLastname());
+            assertEquals(record.getId1(), record2.getId1());
+            assertEquals(record.getId2(), record2.getId2());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    public void testPKFieldsUpdateByPrimaryKeySelective() {
+        PkfieldsDAO dao = getPkfieldsDAO();
+
+        try {
+            Pkfields record = new Pkfields();
+            record.setFirstname("Jeff");
+            record.setLastname("Smith");
+            record.setDecimal60field(5);
+            record.setId1(1);
+            record.setId2(2);
+
+            dao.insert(record);
+
+            Pkfields newRecord = new Pkfields();
+            newRecord.setId1(1);
+            newRecord.setId2(2);
+            newRecord.setFirstname("Scott");
+            newRecord.setDecimal60field(4);
+
+            int rows = dao.updateByPrimaryKeySelective(newRecord);
+            assertEquals(1, rows);
+
+            Pkfields returnedRecord = dao.selectByPrimaryKey(1, 2);
+
+            assertTrue(datesAreEqual(record.getDatefield(), returnedRecord
+                    .getDatefield()));
+            assertEquals(record.getDecimal100field(), returnedRecord
+                    .getDecimal100field());
+            assertEquals(record.getDecimal155field(), returnedRecord
+                    .getDecimal155field());
+            assertEquals(record.getDecimal30field(), returnedRecord
+                    .getDecimal30field());
+            assertEquals(newRecord.getDecimal60field(), returnedRecord
+                    .getDecimal60field());
+            assertEquals(newRecord.getFirstname(), returnedRecord
+                    .getFirstname());
+            assertEquals(record.getId1(), returnedRecord.getId1());
+            assertEquals(record.getId2(), returnedRecord.getId2());
+            assertEquals(record.getLastname(), returnedRecord.getLastname());
+            assertTrue(timesAreEqual(record.getTimefield(), returnedRecord
+                    .getTimefield()));
+            assertEquals(record.getTimestampfield(), returnedRecord
+                    .getTimestampfield());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testPKfieldsDeleteByPrimaryKey() {
+        PkfieldsDAO dao = getPkfieldsDAO();
+
+        try {
+            Pkfields record = new Pkfields();
+            record.setFirstname("Jeff");
+            record.setLastname("Smith");
+            record.setId1(1);
+            record.setId2(2);
+
+            dao.insert(record);
+
+            int rows = dao.deleteByPrimaryKey(1, 2);
+            assertEquals(1, rows);
+
+            PkfieldsExample example = new PkfieldsExample();
+            List answer = dao.selectByExample(example);
+            assertEquals(0, answer.size());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testPKFieldsDeleteByExample() {
+        PkfieldsDAO dao = getPkfieldsDAO();
+
+        try {
+            Pkfields record = new Pkfields();
+            record.setFirstname("Jeff");
+            record.setLastname("Smith");
+            record.setId1(1);
+            record.setId2(2);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Bob");
+            record.setLastname("Jones");
+            record.setId1(3);
+            record.setId2(4);
+
+            dao.insert(record);
+
+            PkfieldsExample example = new PkfieldsExample();
+            List answer = dao.selectByExample(example);
+            assertEquals(2, answer.size());
+
+            example = new PkfieldsExample();
+            example.createCriteria().andLastnameLike("J%");
+            int rows = dao.deleteByExample(example);
+            assertEquals(1, rows);
+
+            example = new PkfieldsExample();
+            answer = dao.selectByExample(example);
+            assertEquals(1, answer.size());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    public void testPKFieldsSelectByPrimaryKey() {
+        PkfieldsDAO dao = getPkfieldsDAO();
+
+        try {
+            Pkfields record = new Pkfields();
+            record.setFirstname("Jeff");
+            record.setLastname("Smith");
+            record.setId1(1);
+            record.setId2(2);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Bob");
+            record.setLastname("Jones");
+            record.setId1(3);
+            record.setId2(4);
+            dao.insert(record);
+
+            Pkfields newRecord = dao.selectByPrimaryKey(3, 4);
+
+            assertNotNull(newRecord);
+            assertEquals(record.getFirstname(), newRecord.getFirstname());
+            assertEquals(record.getLastname(), newRecord.getLastname());
+            assertEquals(record.getId1(), newRecord.getId1());
+            assertEquals(record.getId2(), newRecord.getId2());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testPKFieldsSelectByExampleLike() {
+        PkfieldsDAO dao = getPkfieldsDAO();
+
+        try {
+            Pkfields record = new Pkfields();
+            record.setFirstname("Fred");
+            record.setLastname("Flintstone");
+            record.setId1(1);
+            record.setId2(1);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Wilma");
+            record.setLastname("Flintstone");
+            record.setId1(1);
+            record.setId2(2);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Pebbles");
+            record.setLastname("Flintstone");
+            record.setId1(1);
+            record.setId2(3);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Barney");
+            record.setLastname("Rubble");
+            record.setId1(2);
+            record.setId2(1);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Betty");
+            record.setLastname("Rubble");
+            record.setId1(2);
+            record.setId2(2);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Bamm Bamm");
+            record.setLastname("Rubble");
+            record.setId1(2);
+            record.setId2(3);
+            dao.insert(record);
+
+            PkfieldsExample example = new PkfieldsExample();
+            example.createCriteria().andFirstnameLike("B%");
+            example.setOrderByClause("ID1, ID2");
+            List answer = dao.selectByExample(example);
+            assertEquals(3, answer.size());
+            Pkfields returnedRecord = (Pkfields) answer.get(0);
+            assertEquals(2, returnedRecord.getId1().intValue());
+            assertEquals(1, returnedRecord.getId2().intValue());
+            returnedRecord = (Pkfields) answer.get(1);
+            assertEquals(2, returnedRecord.getId1().intValue());
+            assertEquals(2, returnedRecord.getId2().intValue());
+            returnedRecord = (Pkfields) answer.get(2);
+            assertEquals(2, returnedRecord.getId1().intValue());
+            assertEquals(3, returnedRecord.getId2().intValue());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testPKFieldsSelectByExampleNotLike() {
+        PkfieldsDAO dao = getPkfieldsDAO();
+
+        try {
+            Pkfields record = new Pkfields();
+            record.setFirstname("Fred");
+            record.setLastname("Flintstone");
+            record.setId1(1);
+            record.setId2(1);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Wilma");
+            record.setLastname("Flintstone");
+            record.setId1(1);
+            record.setId2(2);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Pebbles");
+            record.setLastname("Flintstone");
+            record.setId1(1);
+            record.setId2(3);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Barney");
+            record.setLastname("Rubble");
+            record.setId1(2);
+            record.setId2(1);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Betty");
+            record.setLastname("Rubble");
+            record.setId1(2);
+            record.setId2(2);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Bamm Bamm");
+            record.setLastname("Rubble");
+            record.setId1(2);
+            record.setId2(3);
+            dao.insert(record);
+
+            PkfieldsExample example = new PkfieldsExample();
+            example.createCriteria().andFirstnameNotLike("B%");
+            example.setOrderByClause("ID1, ID2");
+            List answer = dao.selectByExample(example);
+            assertEquals(3, answer.size());
+            Pkfields returnedRecord = (Pkfields) answer.get(0);
+            assertEquals(1, returnedRecord.getId1().intValue());
+            assertEquals(1, returnedRecord.getId2().intValue());
+            returnedRecord = (Pkfields) answer.get(1);
+            assertEquals(1, returnedRecord.getId1().intValue());
+            assertEquals(2, returnedRecord.getId2().intValue());
+            returnedRecord = (Pkfields) answer.get(2);
+            assertEquals(1, returnedRecord.getId1().intValue());
+            assertEquals(3, returnedRecord.getId2().intValue());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testPKFieldsSelectByExampleComplexLike() {
+        PkfieldsDAO dao = getPkfieldsDAO();
+
+        try {
+            Pkfields record = new Pkfields();
+            record.setFirstname("Fred");
+            record.setLastname("Flintstone");
+            record.setId1(1);
+            record.setId2(1);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Wilma");
+            record.setLastname("Flintstone");
+            record.setId1(1);
+            record.setId2(2);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Pebbles");
+            record.setLastname("Flintstone");
+            record.setId1(1);
+            record.setId2(3);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Barney");
+            record.setLastname("Rubble");
+            record.setId1(2);
+            record.setId2(1);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Betty");
+            record.setLastname("Rubble");
+            record.setId1(2);
+            record.setId2(2);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Bamm Bamm");
+            record.setLastname("Rubble");
+            record.setId1(2);
+            record.setId2(3);
+            dao.insert(record);
+
+            PkfieldsExample example = new PkfieldsExample();
+            example.createCriteria().andFirstnameLike("B%").andId2EqualTo(3);
+            example.or(example.createCriteria().andFirstnameLike("Wi%"));
+
+            example.setOrderByClause("ID1, ID2");
+            List answer = dao.selectByExample(example);
+            assertEquals(2, answer.size());
+            Pkfields returnedRecord = (Pkfields) answer.get(0);
+            assertEquals(1, returnedRecord.getId1().intValue());
+            assertEquals(2, returnedRecord.getId2().intValue());
+            returnedRecord = (Pkfields) answer.get(1);
+            assertEquals(2, returnedRecord.getId1().intValue());
+            assertEquals(3, returnedRecord.getId2().intValue());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testPKFieldsSelectByExampleIn() {
+        PkfieldsDAO dao = getPkfieldsDAO();
+
+        try {
+            Pkfields record = new Pkfields();
+            record.setFirstname("Fred");
+            record.setLastname("Flintstone");
+            record.setId1(1);
+            record.setId2(1);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Wilma");
+            record.setLastname("Flintstone");
+            record.setId1(1);
+            record.setId2(2);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Pebbles");
+            record.setLastname("Flintstone");
+            record.setId1(1);
+            record.setId2(3);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Barney");
+            record.setLastname("Rubble");
+            record.setId1(2);
+            record.setId2(1);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Betty");
+            record.setLastname("Rubble");
+            record.setId1(2);
+            record.setId2(2);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Bamm Bamm");
+            record.setLastname("Rubble");
+            record.setId1(2);
+            record.setId2(3);
+            dao.insert(record);
+
+            List<Integer> ids = new ArrayList<Integer>();
+            ids.add(1);
+            ids.add(3);
+
+            PkfieldsExample example = new PkfieldsExample();
+            example.createCriteria().andId2In(ids);
+
+            example.setOrderByClause("ID1, ID2");
+            List answer = dao.selectByExample(example);
+            assertEquals(4, answer.size());
+            Pkfields returnedRecord = (Pkfields) answer.get(0);
+            assertEquals(1, returnedRecord.getId1().intValue());
+            assertEquals(1, returnedRecord.getId2().intValue());
+            returnedRecord = (Pkfields) answer.get(1);
+            assertEquals(1, returnedRecord.getId1().intValue());
+            assertEquals(3, returnedRecord.getId2().intValue());
+            returnedRecord = (Pkfields) answer.get(2);
+            assertEquals(2, returnedRecord.getId1().intValue());
+            assertEquals(1, returnedRecord.getId2().intValue());
+            returnedRecord = (Pkfields) answer.get(3);
+            assertEquals(2, returnedRecord.getId1().intValue());
+            assertEquals(3, returnedRecord.getId2().intValue());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testPKFieldsSelectByExampleBetween() {
+        PkfieldsDAO dao = getPkfieldsDAO();
+
+        try {
+            Pkfields record = new Pkfields();
+            record.setFirstname("Fred");
+            record.setLastname("Flintstone");
+            record.setId1(1);
+            record.setId2(1);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Wilma");
+            record.setLastname("Flintstone");
+            record.setId1(1);
+            record.setId2(2);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Pebbles");
+            record.setLastname("Flintstone");
+            record.setId1(1);
+            record.setId2(3);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Barney");
+            record.setLastname("Rubble");
+            record.setId1(2);
+            record.setId2(1);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Betty");
+            record.setLastname("Rubble");
+            record.setId1(2);
+            record.setId2(2);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Bamm Bamm");
+            record.setLastname("Rubble");
+            record.setId1(2);
+            record.setId2(3);
+            dao.insert(record);
+
+            PkfieldsExample example = new PkfieldsExample();
+            example.createCriteria().andId2Between(1, 3);
+
+            example.setOrderByClause("ID1, ID2");
+            List answer = dao.selectByExample(example);
+            assertEquals(6, answer.size());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testPKFieldsSelectByExampleNoCriteria() {
+        PkfieldsDAO dao = getPkfieldsDAO();
+
+        try {
+            Pkfields record = new Pkfields();
+            record.setFirstname("Fred");
+            record.setLastname("Flintstone");
+            record.setId1(1);
+            record.setId2(1);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Wilma");
+            record.setLastname("Flintstone");
+            record.setId1(1);
+            record.setId2(2);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Pebbles");
+            record.setLastname("Flintstone");
+            record.setId1(1);
+            record.setId2(3);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Barney");
+            record.setLastname("Rubble");
+            record.setId1(2);
+            record.setId2(1);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Betty");
+            record.setLastname("Rubble");
+            record.setId1(2);
+            record.setId2(2);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Bamm Bamm");
+            record.setLastname("Rubble");
+            record.setId1(2);
+            record.setId2(3);
+            dao.insert(record);
+
+            PkfieldsExample example = new PkfieldsExample();
+            example.createCriteria();
+
+            example.setOrderByClause("ID1, ID2");
+            List answer = dao.selectByExample(example);
+            assertEquals(6, answer.size());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testPKFieldsSelectByExampleEscapedFields() {
+        PkfieldsDAO dao = getPkfieldsDAO();
+
+        try {
+            Pkfields record = new Pkfields();
+            record.setFirstname("Fred");
+            record.setLastname("Flintstone");
+            record.setId1(1);
+            record.setId2(1);
+            record.setWierdField(11);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Wilma");
+            record.setLastname("Flintstone");
+            record.setId1(1);
+            record.setId2(2);
+            record.setWierdField(22);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Pebbles");
+            record.setLastname("Flintstone");
+            record.setId1(1);
+            record.setId2(3);
+            record.setWierdField(33);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Barney");
+            record.setLastname("Rubble");
+            record.setId1(2);
+            record.setId2(1);
+            record.setWierdField(44);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Betty");
+            record.setLastname("Rubble");
+            record.setId1(2);
+            record.setId2(2);
+            record.setWierdField(55);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Bamm Bamm");
+            record.setLastname("Rubble");
+            record.setId1(2);
+            record.setId2(3);
+            record.setWierdField(66);
+            dao.insert(record);
+
+            List<Integer> values = new ArrayList<Integer>();
+            values.add(11);
+            values.add(22);
+
+            PkfieldsExample example = new PkfieldsExample();
+            example.createCriteria().andWierdFieldLessThan(40).andWierdFieldIn(
+                    values);
+
+            example.setOrderByClause("ID1, ID2");
+            List answer = dao.selectByExample(example);
+            assertEquals(2, answer.size());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    public void testPKFieldsCountByExample() {
+        PkfieldsDAO dao = getPkfieldsDAO();
+
+        try {
+            Pkfields record = new Pkfields();
+            record.setFirstname("Jeff");
+            record.setLastname("Smith");
+            record.setId1(1);
+            record.setId2(2);
+            dao.insert(record);
+
+            record = new Pkfields();
+            record.setFirstname("Bob");
+            record.setLastname("Jones");
+            record.setId1(3);
+            record.setId2(4);
+
+            dao.insert(record);
+
+            PkfieldsExample example = new PkfieldsExample();
+            example.createCriteria().andLastnameLike("J%");
+            int rows = dao.countByExample(example);
+            assertEquals(1, rows);
+
+            example.clear();
+            rows = dao.countByExample(example);
+            assertEquals(2, rows);
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testPKBlobsInsert() {
+        PkblobsDAO dao = getPkblobsDAO();
+
+        try {
+            Pkblobs record = new Pkblobs();
+            record.setId(3);
+            record.setBlob1(generateRandomBlob());
+            record.setBlob2(generateRandomBlob());
+            dao.insert(record);
+
+            PkblobsExample example = new PkblobsExample();
+            List answer = dao.selectByExampleWithBLOBs(example);
+            assertEquals(1, answer.size());
+
+            Pkblobs returnedRecord = (Pkblobs) answer.get(0);
+            assertEquals(record.getId(), returnedRecord.getId());
+            assertTrue(blobsAreEqual(record.getBlob1(), returnedRecord
+                    .getBlob1()));
+            assertTrue(blobsAreEqual(record.getBlob2(), returnedRecord
+                    .getBlob2()));
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    public void testPKBlobsUpdateByPrimaryKeyWithBLOBs() {
+        PkblobsDAO dao = getPkblobsDAO();
+
+        try {
+            Pkblobs record = new Pkblobs();
+            record.setId(3);
+            record.setBlob1(generateRandomBlob());
+            record.setBlob2(generateRandomBlob());
+            dao.insert(record);
+
+            record = new Pkblobs();
+            record.setId(3);
+            record.setBlob1(generateRandomBlob());
+            record.setBlob2(generateRandomBlob());
+            int rows = dao.updateByPrimaryKey(record);
+            assertEquals(1, rows);
+
+            Pkblobs newRecord = dao.selectByPrimaryKey(3);
+
+            assertNotNull(newRecord);
+            assertEquals(record.getId(), newRecord.getId());
+            assertTrue(blobsAreEqual(record.getBlob1(), newRecord.getBlob1()));
+            assertTrue(blobsAreEqual(record.getBlob2(), newRecord.getBlob2()));
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    public void testPKBlobsUpdateByPrimaryKeySelective() {
+        PkblobsDAO dao = getPkblobsDAO();
+
+        try {
+            Pkblobs record = new Pkblobs();
+            record.setId(3);
+            record.setBlob1(generateRandomBlob());
+            record.setBlob2(generateRandomBlob());
+            dao.insert(record);
+
+            Pkblobs newRecord = new Pkblobs();
+            newRecord.setId(3);
+            newRecord.setBlob2(generateRandomBlob());
+            dao.updateByPrimaryKeySelective(newRecord);
+
+            Pkblobs returnedRecord = dao.selectByPrimaryKey(3);
+            assertNotNull(returnedRecord);
+            assertEquals(record.getId(), returnedRecord.getId());
+            assertTrue(blobsAreEqual(record.getBlob1(), returnedRecord
+                    .getBlob1()));
+            assertTrue(blobsAreEqual(newRecord.getBlob2(), returnedRecord
+                    .getBlob2()));
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testPKBlobsDeleteByPrimaryKey() {
+        PkblobsDAO dao = getPkblobsDAO();
+
+        try {
+            Pkblobs record = new Pkblobs();
+            record.setId(3);
+            record.setBlob1(generateRandomBlob());
+            record.setBlob2(generateRandomBlob());
+            dao.insert(record);
+
+            PkblobsExample example = new PkblobsExample();
+            List answer = dao.selectByExampleWithoutBLOBs(example);
+            assertEquals(1, answer.size());
+
+            int rows = dao.deleteByPrimaryKey(3);
+            assertEquals(1, rows);
+
+            example = new PkblobsExample();
+            answer = dao.selectByExampleWithoutBLOBs(example);
+            assertEquals(0, answer.size());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testPKBlobsDeleteByExample() {
+        PkblobsDAO dao = getPkblobsDAO();
+
+        try {
+            Pkblobs record = new Pkblobs();
+            record.setId(3);
+            record.setBlob1(generateRandomBlob());
+            record.setBlob2(generateRandomBlob());
+            dao.insert(record);
+
+            record = new Pkblobs();
+            record.setId(6);
+            record.setBlob1(generateRandomBlob());
+            record.setBlob2(generateRandomBlob());
+            dao.insert(record);
+
+            PkblobsExample example = new PkblobsExample();
+            List answer = dao.selectByExampleWithoutBLOBs(example);
+            assertEquals(2, answer.size());
+
+            example = new PkblobsExample();
+            example.createCriteria().andIdLessThan(4);
+            int rows = dao.deleteByExample(example);
+            assertEquals(1, rows);
+
+            example = new PkblobsExample();
+            answer = dao.selectByExampleWithoutBLOBs(example);
+            assertEquals(1, answer.size());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    public void testPKBlobsSelectByPrimaryKey() {
+        PkblobsDAO dao = getPkblobsDAO();
+
+        try {
+            Pkblobs record = new Pkblobs();
+            record.setId(3);
+            record.setBlob1(generateRandomBlob());
+            record.setBlob2(generateRandomBlob());
+            dao.insert(record);
+
+            record = new Pkblobs();
+            record.setId(6);
+            record.setBlob1(generateRandomBlob());
+            record.setBlob2(generateRandomBlob());
+            dao.insert(record);
+
+            Pkblobs newRecord = dao.selectByPrimaryKey(6);
+            assertNotNull(newRecord);
+            assertEquals(record.getId(), newRecord.getId());
+            assertTrue(blobsAreEqual(record.getBlob1(), newRecord.getBlob1()));
+            assertTrue(blobsAreEqual(record.getBlob2(), newRecord.getBlob2()));
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testPKBlobsSelectByExampleWithoutBlobs() {
+        PkblobsDAO dao = getPkblobsDAO();
+
+        try {
+            Pkblobs record = new Pkblobs();
+            record.setId(3);
+            record.setBlob1(generateRandomBlob());
+            record.setBlob2(generateRandomBlob());
+            dao.insert(record);
+
+            record = new Pkblobs();
+            record.setId(6);
+            record.setBlob1(generateRandomBlob());
+            record.setBlob2(generateRandomBlob());
+            dao.insert(record);
+
+            PkblobsExample example = new PkblobsExample();
+            example.createCriteria().andIdGreaterThan(4);
+            List answer = dao.selectByExampleWithoutBLOBs(example);
+
+            assertEquals(1, answer.size());
+
+            Pkblobs key = (Pkblobs) answer.get(0);
+            assertEquals(6, key.getId().intValue());
+            assertNull(key.getBlob1());
+            assertNull(key.getBlob2());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testPKBlobsSelectByExampleWithoutBlobsNoCriteria() {
+        PkblobsDAO dao = getPkblobsDAO();
+
+        try {
+            Pkblobs record = new Pkblobs();
+            record.setId(3);
+            record.setBlob1(generateRandomBlob());
+            record.setBlob2(generateRandomBlob());
+            dao.insert(record);
+
+            record = new Pkblobs();
+            record.setId(6);
+            record.setBlob1(generateRandomBlob());
+            record.setBlob2(generateRandomBlob());
+            dao.insert(record);
+
+            PkblobsExample example = new PkblobsExample();
+            example.createCriteria();
+            List answer = dao.selectByExampleWithoutBLOBs(example);
+
+            assertEquals(2, answer.size());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testPKBlobsSelectByExampleWithBlobs() {
+        PkblobsDAO dao = getPkblobsDAO();
+
+        try {
+            Pkblobs record = new Pkblobs();
+            record.setId(3);
+            record.setBlob1(generateRandomBlob());
+            record.setBlob2(generateRandomBlob());
+            dao.insert(record);
+
+            record = new Pkblobs();
+            record.setId(6);
+            record.setBlob1(generateRandomBlob());
+            record.setBlob2(generateRandomBlob());
+            dao.insert(record);
+
+            PkblobsExample example = new PkblobsExample();
+            example.createCriteria().andIdGreaterThan(4);
+            List answer = dao.selectByExampleWithBLOBs(example);
+
+            assertEquals(1, answer.size());
+
+            Pkblobs newRecord = (Pkblobs) answer.get(0);
+            assertEquals(record.getId(), newRecord.getId());
+            assertTrue(blobsAreEqual(record.getBlob1(), newRecord.getBlob1()));
+            assertTrue(blobsAreEqual(record.getBlob2(), newRecord.getBlob2()));
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    public void testPKBlobsCountByExample() {
+        PkblobsDAO dao = getPkblobsDAO();
+
+        try {
+            Pkblobs record = new Pkblobs();
+            record.setId(3);
+            record.setBlob1(generateRandomBlob());
+            record.setBlob2(generateRandomBlob());
+            dao.insert(record);
+
+            record = new Pkblobs();
+            record.setId(6);
+            record.setBlob1(generateRandomBlob());
+            record.setBlob2(generateRandomBlob());
+            dao.insert(record);
+
+            PkblobsExample example = new PkblobsExample();
+            example.createCriteria().andIdLessThan(4);
+            int rows = dao.countByExample(example);
+            assertEquals(1, rows);
+
+            example.clear();
+            rows = dao.countByExample(example);
+            assertEquals(2, rows);
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testPKFieldsBlobsInsert() {
+        PkfieldsblobsDAO dao = getPkfieldsblobsDAO();
+
+        try {
+            Pkfieldsblobs record = new Pkfieldsblobs();
+            record.setId1(3);
+            record.setId2(4);
+            record.setFirstname("Jeff");
+            record.setLastname("Smith");
+            record.setBlob1(generateRandomBlob());
+            dao.insert(record);
+
+            PkfieldsblobsExample example = new PkfieldsblobsExample();
+            List answer = dao.selectByExampleWithBLOBs(example);
+            assertEquals(1, answer.size());
+
+            Pkfieldsblobs returnedRecord = (Pkfieldsblobs) answer.get(0);
+            assertEquals(record.getId1(), returnedRecord.getId1());
+            assertEquals(record.getId2(), returnedRecord.getId2());
+            assertEquals(record.getFirstname(), returnedRecord.getFirstname());
+            assertEquals(record.getLastname(), returnedRecord.getLastname());
+            assertTrue(blobsAreEqual(record.getBlob1(), returnedRecord
+                    .getBlob1()));
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    public void testPKFieldsBlobsUpdateByPrimaryKeyWithBLOBs() {
+        PkfieldsblobsDAO dao = getPkfieldsblobsDAO();
+
+        try {
+            Pkfieldsblobs record = new Pkfieldsblobs();
+            record.setId1(3);
+            record.setId2(4);
+            record.setFirstname("Jeff");
+            record.setLastname("Smith");
+            record.setBlob1(generateRandomBlob());
+            dao.insert(record);
+
+            Pkfieldsblobs updateRecord = new Pkfieldsblobs();
+            updateRecord.setId1(3);
+            updateRecord.setId2(4);
+            updateRecord.setFirstname("Scott");
+            updateRecord.setLastname("Jones");
+            updateRecord.setBlob1(generateRandomBlob());
+
+            int rows = dao.updateByPrimaryKeyWithBLOBs(updateRecord);
+            assertEquals(1, rows);
+
+            Pkfieldsblobs newRecord = dao.selectByPrimaryKey(3, 4);
+            assertEquals(updateRecord.getFirstname(), newRecord.getFirstname());
+            assertEquals(updateRecord.getLastname(), newRecord.getLastname());
+            assertEquals(record.getId1(), newRecord.getId1());
+            assertEquals(record.getId2(), newRecord.getId2());
+            assertTrue(blobsAreEqual(updateRecord.getBlob1(), newRecord
+                    .getBlob1()));
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    public void testPKFieldsBlobsUpdateByPrimaryKeyWithoutBLOBs() {
+        PkfieldsblobsDAO dao = getPkfieldsblobsDAO();
+
+        try {
+            Pkfieldsblobs record = new Pkfieldsblobs();
+            record.setId1(3);
+            record.setId2(4);
+            record.setFirstname("Jeff");
+            record.setLastname("Smith");
+            record.setBlob1(generateRandomBlob());
+            dao.insert(record);
+
+            Pkfieldsblobs updateRecord = new Pkfieldsblobs();
+            updateRecord.setId1(3);
+            updateRecord.setId2(4);
+            updateRecord.setFirstname("Scott");
+            updateRecord.setLastname("Jones");
+
+            int rows = dao.updateByPrimaryKeyWithoutBLOBs(updateRecord);
+            assertEquals(1, rows);
+
+            Pkfieldsblobs newRecord = dao.selectByPrimaryKey(3, 4);
+            assertEquals(updateRecord.getFirstname(), newRecord.getFirstname());
+            assertEquals(updateRecord.getLastname(), newRecord.getLastname());
+            assertEquals(record.getId1(), newRecord.getId1());
+            assertEquals(record.getId2(), newRecord.getId2());
+            assertTrue(blobsAreEqual(record.getBlob1(), newRecord.getBlob1()));
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    public void testPKFieldsBlobsUpdateByPrimaryKeySelective() {
+        PkfieldsblobsDAO dao = getPkfieldsblobsDAO();
+
+        try {
+            Pkfieldsblobs record = new Pkfieldsblobs();
+            record.setId1(3);
+            record.setId2(4);
+            record.setFirstname("Jeff");
+            record.setLastname("Smith");
+            record.setBlob1(generateRandomBlob());
+            dao.insert(record);
+
+            Pkfieldsblobs updateRecord = new Pkfieldsblobs();
+            updateRecord.setId1(3);
+            updateRecord.setId2(4);
+            updateRecord.setLastname("Jones");
+
+            int rows = dao.updateByPrimaryKeySelective(updateRecord);
+            assertEquals(1, rows);
+
+            Pkfieldsblobs returnedRecord = dao.selectByPrimaryKey(3, 4);
+            assertEquals(record.getFirstname(), returnedRecord.getFirstname());
+            assertEquals(updateRecord.getLastname(), returnedRecord
+                    .getLastname());
+            assertEquals(record.getId1(), returnedRecord.getId1());
+            assertEquals(record.getId2(), returnedRecord.getId2());
+            assertTrue(blobsAreEqual(record.getBlob1(), returnedRecord
+                    .getBlob1()));
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testPKFieldsBlobsDeleteByPrimaryKey() {
+        PkfieldsblobsDAO dao = getPkfieldsblobsDAO();
+
+        try {
+            Pkfieldsblobs record = new Pkfieldsblobs();
+            record.setId1(3);
+            record.setId2(4);
+            record.setFirstname("Jeff");
+            record.setLastname("Smith");
+            record.setBlob1(generateRandomBlob());
+            dao.insert(record);
+
+            record = new Pkfieldsblobs();
+            record.setId1(5);
+            record.setId2(6);
+            record.setFirstname("Scott");
+            record.setLastname("Jones");
+            record.setBlob1(generateRandomBlob());
+            dao.insert(record);
+
+            PkfieldsblobsExample example = new PkfieldsblobsExample();
+            List answer = dao.selectByExampleWithoutBLOBs(example);
+            assertEquals(2, answer.size());
+
+            int rows = dao.deleteByPrimaryKey(5, 6);
+            assertEquals(1, rows);
+
+            example = new PkfieldsblobsExample();
+            answer = dao.selectByExampleWithoutBLOBs(example);
+            assertEquals(1, answer.size());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testPKFieldsBlobsDeleteByExample() {
+        PkfieldsblobsDAO dao = getPkfieldsblobsDAO();
+
+        try {
+            Pkfieldsblobs record = new Pkfieldsblobs();
+            record.setId1(3);
+            record.setId2(4);
+            record.setFirstname("Jeff");
+            record.setLastname("Smith");
+            record.setBlob1(generateRandomBlob());
+            dao.insert(record);
+
+            record = new Pkfieldsblobs();
+            record.setId1(5);
+            record.setId2(6);
+            record.setFirstname("Scott");
+            record.setLastname("Jones");
+            record.setBlob1(generateRandomBlob());
+            dao.insert(record);
+
+            PkfieldsblobsExample example = new PkfieldsblobsExample();
+            List answer = dao.selectByExampleWithoutBLOBs(example);
+            assertEquals(2, answer.size());
+
+            example = new PkfieldsblobsExample();
+            example.createCriteria().andId1NotEqualTo(3);
+            int rows = dao.deleteByExample(example);
+            assertEquals(1, rows);
+
+            example = new PkfieldsblobsExample();
+            answer = dao.selectByExampleWithoutBLOBs(example);
+            assertEquals(1, answer.size());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testPKFieldsBlobsSelectByPrimaryKey() {
+        PkfieldsblobsDAO dao = getPkfieldsblobsDAO();
+
+        try {
+            Pkfieldsblobs record = new Pkfieldsblobs();
+            record.setId1(3);
+            record.setId2(4);
+            record.setFirstname("Jeff");
+            record.setLastname("Smith");
+            record.setBlob1(generateRandomBlob());
+            dao.insert(record);
+
+            record = new Pkfieldsblobs();
+            record.setId1(5);
+            record.setId2(6);
+            record.setFirstname("Scott");
+            record.setLastname("Jones");
+            record.setBlob1(generateRandomBlob());
+            dao.insert(record);
+
+            PkfieldsblobsExample example = new PkfieldsblobsExample();
+            List answer = dao.selectByExampleWithoutBLOBs(example);
+            assertEquals(2, answer.size());
+
+            Pkfieldsblobs newRecord = dao.selectByPrimaryKey(5, 6);
+            assertEquals(record.getId1(), newRecord.getId1());
+            assertEquals(record.getId2(), newRecord.getId2());
+            assertEquals(record.getFirstname(), newRecord.getFirstname());
+            assertEquals(record.getLastname(), newRecord.getLastname());
+            assertTrue(blobsAreEqual(record.getBlob1(), newRecord.getBlob1()));
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testPKFieldsBlobsSelectByExampleWithoutBlobs() {
+        PkfieldsblobsDAO dao = getPkfieldsblobsDAO();
+
+        try {
+            Pkfieldsblobs record = new Pkfieldsblobs();
+            record.setId1(3);
+            record.setId2(4);
+            record.setFirstname("Jeff");
+            record.setLastname("Smith");
+            record.setBlob1(generateRandomBlob());
+            dao.insert(record);
+
+            record = new Pkfieldsblobs();
+            record.setId1(5);
+            record.setId2(6);
+            record.setFirstname("Scott");
+            record.setLastname("Jones");
+            record.setBlob1(generateRandomBlob());
+            dao.insert(record);
+
+            PkfieldsblobsExample example = new PkfieldsblobsExample();
+            example.createCriteria().andId2EqualTo(6);
+            List answer = dao.selectByExampleWithoutBLOBs(example);
+            assertEquals(1, answer.size());
+
+            Pkfieldsblobs newRecord = (Pkfieldsblobs) answer.get(0);
+            assertEquals(record.getId1(), newRecord.getId1());
+            assertEquals(record.getId2(), newRecord.getId2());
+            assertEquals(record.getFirstname(), newRecord.getFirstname());
+            assertEquals(record.getLastname(), newRecord.getLastname());
+            assertNull(newRecord.getBlob1());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testPKFieldsBlobsSelectByExampleWithBlobs() {
+        PkfieldsblobsDAO dao = getPkfieldsblobsDAO();
+
+        try {
+            Pkfieldsblobs record = new Pkfieldsblobs();
+            record.setId1(3);
+            record.setId2(4);
+            record.setFirstname("Jeff");
+            record.setLastname("Smith");
+            record.setBlob1(generateRandomBlob());
+            dao.insert(record);
+
+            record = new Pkfieldsblobs();
+            record.setId1(5);
+            record.setId2(6);
+            record.setFirstname("Scott");
+            record.setLastname("Jones");
+            record.setBlob1(generateRandomBlob());
+            dao.insert(record);
+
+            PkfieldsblobsExample example = new PkfieldsblobsExample();
+            example.createCriteria().andId2EqualTo(6);
+            List answer = dao.selectByExampleWithBLOBs(example);
+            assertEquals(1, answer.size());
+
+            Pkfieldsblobs newRecord = (Pkfieldsblobs) answer.get(0);
+            assertEquals(record.getId1(), newRecord.getId1());
+            assertEquals(record.getId2(), newRecord.getId2());
+            assertEquals(record.getFirstname(), newRecord.getFirstname());
+            assertEquals(record.getLastname(), newRecord.getLastname());
+            assertTrue(blobsAreEqual(record.getBlob1(), newRecord.getBlob1()));
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testPKFieldsBlobsSelectByExampleWithBlobsNoCriteria() {
+        PkfieldsblobsDAO dao = getPkfieldsblobsDAO();
+
+        try {
+            Pkfieldsblobs record = new Pkfieldsblobs();
+            record.setId1(3);
+            record.setId2(4);
+            record.setFirstname("Jeff");
+            record.setLastname("Smith");
+            record.setBlob1(generateRandomBlob());
+            dao.insert(record);
+
+            record = new Pkfieldsblobs();
+            record.setId1(5);
+            record.setId2(6);
+            record.setFirstname("Scott");
+            record.setLastname("Jones");
+            record.setBlob1(generateRandomBlob());
+            dao.insert(record);
+
+            PkfieldsblobsExample example = new PkfieldsblobsExample();
+            example.createCriteria();
+            List answer = dao.selectByExampleWithBLOBs(example);
+            assertEquals(2, answer.size());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    public void testPKFieldsBlobsCountByExample() {
+        PkfieldsblobsDAO dao = getPkfieldsblobsDAO();
+
+        try {
+            Pkfieldsblobs record = new Pkfieldsblobs();
+            record.setId1(3);
+            record.setId2(4);
+            record.setFirstname("Jeff");
+            record.setLastname("Smith");
+            record.setBlob1(generateRandomBlob());
+            dao.insert(record);
+
+            record = new Pkfieldsblobs();
+            record.setId1(5);
+            record.setId2(6);
+            record.setFirstname("Scott");
+            record.setLastname("Jones");
+            record.setBlob1(generateRandomBlob());
+            dao.insert(record);
+
+            PkfieldsblobsExample example = new PkfieldsblobsExample();
+            example.createCriteria().andId1NotEqualTo(3);
+            int rows = dao.countByExample(example);
+            assertEquals(1, rows);
+
+            example.clear();
+            rows = dao.countByExample(example);
+            assertEquals(2, rows);
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testFieldsBlobsInsert() {
+        FieldsblobsDAO dao = getFieldsblobsDAO();
+
+        try {
+            Fieldsblobs record = new Fieldsblobs();
+            record.setFirstname("Jeff");
+            record.setLastname("Smith");
+            record.setBlob1(generateRandomBlob());
+            record.setBlob2(generateRandomBlob());
+            dao.insert(record);
+
+            FieldsblobsExample example = new FieldsblobsExample();
+            List answer = dao.selectByExampleWithBLOBs(example);
+            assertEquals(1, answer.size());
+
+            Fieldsblobs returnedRecord = (Fieldsblobs) answer.get(0);
+            assertEquals(record.getFirstname(), returnedRecord.getFirstname());
+            assertEquals(record.getLastname(), returnedRecord.getLastname());
+            assertTrue(blobsAreEqual(record.getBlob1(), returnedRecord
+                    .getBlob1()));
+            assertTrue(blobsAreEqual(record.getBlob2(), returnedRecord
+                    .getBlob2()));
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testFieldsBlobsDeleteByExample() {
+        FieldsblobsDAO dao = getFieldsblobsDAO();
+
+        try {
+            Fieldsblobs record = new Fieldsblobs();
+            record.setFirstname("Jeff");
+            record.setLastname("Smith");
+            record.setBlob1(generateRandomBlob());
+            record.setBlob2(generateRandomBlob());
+            dao.insert(record);
+
+            record = new Fieldsblobs();
+            record.setFirstname("Scott");
+            record.setLastname("Jones");
+            record.setBlob1(generateRandomBlob());
+            record.setBlob2(generateRandomBlob());
+            dao.insert(record);
+
+            FieldsblobsExample example = new FieldsblobsExample();
+            List answer = dao.selectByExampleWithoutBLOBs(example);
+            assertEquals(2, answer.size());
+
+            example = new FieldsblobsExample();
+            example.createCriteria().andFirstnameLike("S%");
+            int rows = dao.deleteByExample(example);
+            assertEquals(1, rows);
+
+            example = new FieldsblobsExample();
+            answer = dao.selectByExampleWithoutBLOBs(example);
+            assertEquals(1, answer.size());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testFieldsBlobsSelectByExampleWithoutBlobs() {
+        FieldsblobsDAO dao = getFieldsblobsDAO();
+
+        try {
+            Fieldsblobs record = new Fieldsblobs();
+            record.setFirstname("Jeff");
+            record.setLastname("Smith");
+            record.setBlob1(generateRandomBlob());
+            record.setBlob2(generateRandomBlob());
+            dao.insert(record);
+
+            record = new Fieldsblobs();
+            record.setFirstname("Scott");
+            record.setLastname("Jones");
+            record.setBlob1(generateRandomBlob());
+            record.setBlob2(generateRandomBlob());
+            dao.insert(record);
+
+            FieldsblobsExample example = new FieldsblobsExample();
+            example.createCriteria().andFirstnameLike("S%");
+            List answer = dao.selectByExampleWithoutBLOBs(example);
+            assertEquals(1, answer.size());
+
+            Fieldsblobs newRecord = (Fieldsblobs) answer.get(0);
+            assertEquals(record.getFirstname(), newRecord.getFirstname());
+            assertEquals(record.getLastname(), newRecord.getLastname());
+            assertNull(newRecord.getBlob1());
+            assertNull(newRecord.getBlob2());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testFieldsBlobsSelectByExampleWithBlobs() {
+        FieldsblobsDAO dao = getFieldsblobsDAO();
+
+        try {
+            Fieldsblobs record = new Fieldsblobs();
+            record.setFirstname("Jeff");
+            record.setLastname("Smith");
+            record.setBlob1(generateRandomBlob());
+            record.setBlob2(generateRandomBlob());
+            dao.insert(record);
+
+            record = new Fieldsblobs();
+            record.setFirstname("Scott");
+            record.setLastname("Jones");
+            record.setBlob1(generateRandomBlob());
+            record.setBlob2(generateRandomBlob());
+            dao.insert(record);
+
+            FieldsblobsExample example = new FieldsblobsExample();
+            example.createCriteria().andFirstnameLike("S%");
+            List answer = dao.selectByExampleWithBLOBs(example);
+            assertEquals(1, answer.size());
+
+            Fieldsblobs newRecord = (Fieldsblobs) answer.get(0);
+            assertEquals(record.getFirstname(), newRecord.getFirstname());
+            assertEquals(record.getLastname(), newRecord.getLastname());
+            assertTrue(blobsAreEqual(record.getBlob1(), newRecord.getBlob1()));
+            assertTrue(blobsAreEqual(record.getBlob2(), newRecord.getBlob2()));
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testFieldsBlobsSelectByExampleWithBlobsNoCriteria() {
+        FieldsblobsDAO dao = getFieldsblobsDAO();
+
+        try {
+            Fieldsblobs record = new Fieldsblobs();
+            record.setFirstname("Jeff");
+            record.setLastname("Smith");
+            record.setBlob1(generateRandomBlob());
+            record.setBlob2(generateRandomBlob());
+            dao.insert(record);
+
+            record = new Fieldsblobs();
+            record.setFirstname("Scott");
+            record.setLastname("Jones");
+            record.setBlob1(generateRandomBlob());
+            record.setBlob2(generateRandomBlob());
+            dao.insert(record);
+
+            FieldsblobsExample example = new FieldsblobsExample();
+            example.createCriteria();
+            List answer = dao.selectByExampleWithBLOBs(example);
+            assertEquals(2, answer.size());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    public void testFieldsBlobsCountByExample() {
+        FieldsblobsDAO dao = getFieldsblobsDAO();
+
+        try {
+            Fieldsblobs record = new Fieldsblobs();
+            record.setFirstname("Jeff");
+            record.setLastname("Smith");
+            record.setBlob1(generateRandomBlob());
+            record.setBlob2(generateRandomBlob());
+            dao.insert(record);
+
+            record = new Fieldsblobs();
+            record.setFirstname("Scott");
+            record.setLastname("Jones");
+            record.setBlob1(generateRandomBlob());
+            record.setBlob2(generateRandomBlob());
+            dao.insert(record);
+
+            FieldsblobsExample example = new FieldsblobsExample();
+            example.createCriteria().andFirstnameLike("S%");
+            int rows = dao.countByExample(example);
+            assertEquals(1, rows);
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    public void testAwfulTableInsert() {
+        AwfulTableDAO dao = getAwfulTableDAO();
+
+        try {
+            AwfulTable record = new AwfulTable();
+
+            record.seteMail("fred@fred.com");
+            record.setEmailaddress("alsofred@fred.com");
+            record.setFirstFirstName("fred1");
+            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.insert(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(record.getFirstFirstName(), 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 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();
+
+        try {
+            AwfulTable record = new AwfulTable();
+            record.seteMail("fred@fred.com");
+            record.setEmailaddress("alsofred@fred.com");
+            record.setFirstFirstName("fred1");
+            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.insert(record);
+
+            record.setId1(11);
+            record.setId2(22);
+
+            int rows = dao.updateByPrimaryKey(record);
+            assertEquals(1, rows);
+
+            AwfulTable returnedRecord = dao.selectByPrimaryKey(generatedCustomerId);
+
+            assertEquals(generatedCustomerId, returnedRecord.getCustomerId());
+            assertEquals(record.geteMail(), returnedRecord.geteMail());
+            assertEquals(record.getEmailaddress(), returnedRecord
+                    .getEmailaddress());
+            assertEquals(record.getFirstFirstName(), 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 testAwfulTableUpdateByPrimaryKeySelective() {
+        AwfulTableDAO dao = getAwfulTableDAO();
+
+        try {
+            AwfulTable record = new AwfulTable();
+            record.seteMail("fred@fred.com");
+            record.setEmailaddress("alsofred@fred.com");
+            record.setFirstFirstName("fred1");
+            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.insert(record);
+
+            AwfulTable newRecord = new AwfulTable();
+            newRecord.setCustomerId(generatedCustomerId);
+            newRecord.setId1(11);
+            newRecord.setId2(22);
+
+            int rows = dao.updateByPrimaryKeySelective(newRecord);
+            assertEquals(1, rows);
+
+            AwfulTable returnedRecord = dao.selectByPrimaryKey(generatedCustomerId);
+
+            assertEquals(generatedCustomerId, returnedRecord.getCustomerId());
+            assertEquals(record.geteMail(), returnedRecord.geteMail());
+            assertEquals(record.getEmailaddress(), returnedRecord
+                    .getEmailaddress());
+            assertEquals(record.getFirstFirstName(), returnedRecord
+                    .getFirstFirstName());
+            assertEquals(record.getFourthFirstName(), returnedRecord
+                    .getFourthFirstName());
+            assertEquals(record.getFrom(), returnedRecord.getFrom());
+            assertEquals(newRecord.getId1(), returnedRecord.getId1());
+            assertEquals(newRecord.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());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testAwfulTableDeleteByPrimaryKey() {
+        AwfulTableDAO dao = getAwfulTableDAO();
+
+        try {
+            AwfulTable record = new AwfulTable();
+            record.seteMail("fred@fred.com");
+            record.setEmailaddress("alsofred@fred.com");
+            record.setFirstFirstName("fred1");
+            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.insert(record);
+
+            int rows = dao.deleteByPrimaryKey(generatedCustomerId);
+            assertEquals(1, rows);
+
+            AwfulTableExample example = new AwfulTableExample();
+            List answer = dao.selectByExample(example);
+            assertEquals(0, answer.size());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testAwfulTableDeleteByExample() {
+        AwfulTableDAO dao = getAwfulTableDAO();
+
+        try {
+            AwfulTable record = new AwfulTable();
+            record.seteMail("fred@fred.com");
+            record.setEmailaddress("alsofred@fred.com");
+            record.setFirstFirstName("fred1");
+            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");
+
+            dao.insert(record);
+
+            record = new AwfulTable();
+            record.seteMail("fred2@fred.com");
+            record.setEmailaddress("alsofred2@fred.com");
+            record.setFirstFirstName("fred11");
+            record.setFourthFirstName("fred44");
+            record.setFrom("from from field");
+            record.setId1(11);
+            record.setId2(22);
+            record.setId5(55);
+            record.setId6(66);
+            record.setId7(77);
+            record.setSecondCustomerId(567567);
+            record.setSecondFirstName("fred22");
+            record.setThirdFirstName("fred33");
+
+            dao.insert(record);
+
+            AwfulTableExample example = new AwfulTableExample();
+            List answer = dao.selectByExample(example);
+            assertEquals(2, answer.size());
+
+            example = new AwfulTableExample();
+            example.createCriteria().andEMailLike("fred@%");
+            int rows = dao.deleteByExample(example);
+            assertEquals(1, rows);
+
+            example.clear();
+            answer = dao.selectByExample(example);
+            assertEquals(1, answer.size());
+        } catch (SQLException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    public void testAwfulTableSelectByPrimaryKey() {
+        AwfulTableDAO dao = getAwfulTableDAO();
+
+        try {
+            AwfulTable record = new AwfulTable();
+            record.seteMail("fred@fred.com");
+            record.setEmailaddress("alsofred@fred.com");
+            record.setFirstFirstName("fred1");
+            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");
+
+            dao.insert(record);
+
+            record = new AwfulTable();
+            record.seteMail("fred2@fred.com");
+            record.setEmailaddress("alsofred2@fred.com");
+            record.setFirstFirstName("fred11");
+            record.setFourthFirstName("fred44");
+            record.setFrom("from from field");
+            record.setId1(11);
+            record.setId2(22);
+            record.setId5(55);
+            record.setId6(66);
+            record.setId7(77);
+            record.setSecondCustomerId(567567);
+            record.setSecondFirstName("fred22");
+            record.setThirdFirstName("fred33");
+
+            Integer generatedKey = dao.insert(record);
+
+            AwfulTable returnedRecord = dao.selectByPrimaryKey(generatedKey);
+
+            assertNotNull(returnedRecord);
+            assertEquals(record.getCustomerId(), returnedRecord.getCustomerId());
+            assertEquals(record.geteMail(), returnedRecord.geteMail());
+            assertEquals(record.getEmailaddress(), returnedRecord
+                    .getEmailaddress());
+            assertEquals(record.getFirstFirstName(), 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());
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void testAwfulTableSelectByExampleLike() {
+        AwfulTableDAO dao = getAwfulTableDAO();
+
+        try {
+            AwfulTable record = new AwfulTable();
+            record.seteMail("fred@fred.com");
+            record.setEmailaddress("alsofred@fred.com");
+            record.setFirstFirstName("fred1");
+            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");
+            dao.insert(record);
+
+            record = new AwfulTable();
+            record.seteMail("wilma@wilma.com");
+            record.setEmailaddress("alsoWilma@wilma.com");
+            record.setFirstFirstName("wilma1");
+            record.setFourthFirstName("wilma4");
+            record.setFrom("from field");
+            record.setId1(11);
+            record.setId2(22);
+            record.setId5(55);
+            record.setId6(66);
+            record.setId7(77);
+            record.setSecondCustomerId(567567);
+            record.setSecondFirstName("wilma2");
+            record.setThirdFirstName("wilma3");
+            dao.insert(record);
+
+            record = new AwfulTable();
+            record.seteMail("pebbles@pebbles.com");
+            record.setEmailaddress("alsoPebbles@pebbles.com");
+            record.setFirstFirstName("pebbles1");
+            record.setFourthFirstName("pebbles4");
+            record.setFrom("from field");
+            record.setId1(111);
+            record.setId2(222);

[... 721 lines stripped ...]


Mime
View raw message