Package mbg.test.ib2j5.generated.conditional.dao

Examples of mbg.test.ib2j5.generated.conditional.dao.PkblobsDAO


            fail(e.getMessage());
        }
    }

    public void testPKBlobsSelectByExampleWithoutBlobs() {
        PkblobsDAO dao = getPkblobsDAO();
   
        try {
            Pkblobs record = new Pkblobs();
            record.setId(new Integer(3));
            record.setBlob1(TestUtilities.generateRandomBlob());
            record.setBlob2(TestUtilities.generateRandomBlob());
            dao.insert(record);
   
            record = new Pkblobs();
            record.setId(new Integer(6));
            record.setBlob1(TestUtilities.generateRandomBlob());
            record.setBlob2(TestUtilities.generateRandomBlob());
            dao.insert(record);
   
            PkblobsExample example = new PkblobsExample();
            example.createCriteria().andIdGreaterThan(new Integer(4));
            List answer = dao.selectByExampleWithoutBLOBs(example);
   
            assertEquals(1, answer.size());
   
            Pkblobs key = (Pkblobs) answer.get(0);
            assertEquals(6, key.getId().intValue());
View Full Code Here


            fail(e.getMessage());
        }
    }

    public void testPKBlobsSelectByExampleWithoutBlobsNoCriteria() {
        PkblobsDAO dao = getPkblobsDAO();
   
        try {
            Pkblobs record = new Pkblobs();
            record.setId(new Integer(3));
            record.setBlob1(TestUtilities.generateRandomBlob());
            record.setBlob2(TestUtilities.generateRandomBlob());
            dao.insert(record);
   
            record = new Pkblobs();
            record.setId(new Integer(6));
            record.setBlob1(TestUtilities.generateRandomBlob());
            record.setBlob2(TestUtilities.generateRandomBlob());
            dao.insert(record);
   
            PkblobsExample example = new PkblobsExample();
            example.createCriteria();
            List answer = dao.selectByExampleWithoutBLOBs(example);
   
            assertEquals(2, answer.size());
        } catch (Exception e) {
            fail(e.getMessage());
        }
View Full Code Here

            fail(e.getMessage());
        }
    }

    public void testPKBlobsSelectByExampleWithBlobs() {
        PkblobsDAO dao = getPkblobsDAO();
   
        try {
            Pkblobs record = new Pkblobs();
            record.setId(new Integer(3));
            record.setBlob1(TestUtilities.generateRandomBlob());
            record.setBlob2(TestUtilities.generateRandomBlob());
            dao.insert(record);
   
            record = new Pkblobs();
            record.setId(new Integer(6));
            record.setBlob1(TestUtilities.generateRandomBlob());
            record.setBlob2(TestUtilities.generateRandomBlob());
            dao.insert(record);
   
            PkblobsExample example = new PkblobsExample();
            example.createCriteria().andIdGreaterThan(new Integer(4));
            List answer = dao.selectByExampleWithBLOBs(example);
   
            assertEquals(1, answer.size());
   
            Pkblobs newRecord = (Pkblobs) answer.get(0);
            assertEquals(record.getId(), newRecord.getId());
View Full Code Here

    PkfieldsDAO dao = (PkfieldsDAO) factory.getBean("PkfieldsDAO");
    return dao;
  }

  protected PkblobsDAO getPkblobsDAO() {
    PkblobsDAO dao = (PkblobsDAO) factory.getBean("PkblobsDAO");
    return dao;
  }
View Full Code Here

            fail(e.getMessage());
        }
    }

    public void testPKBlobsUpdateByPrimaryKeyWithBLOBs() {
        PkblobsDAO dao = getPkblobsDAO();
   
        try {
            Pkblobs record = new Pkblobs();
            record.setId(new Integer(3));
            record.setBlob1(TestUtilities.generateRandomBlob());
            record.setBlob2(TestUtilities.generateRandomBlob());
            dao.insert(record);
   
            record = new Pkblobs();
            record.setId(new Integer(3));
            record.setBlob1(TestUtilities.generateRandomBlob());
            record.setBlob2(TestUtilities.generateRandomBlob());
            dao.updateByPrimaryKey(record);
   
            Pkblobs newRecord = dao.selectByPrimaryKey(new Integer(3));
   
            assertNotNull(newRecord);
            assertEquals(record.getId(), newRecord.getId());
            assertTrue(TestUtilities.blobsAreEqual(record.getBlob1(), newRecord.getBlob1()));
            assertTrue(TestUtilities.blobsAreEqual(record.getBlob2(), newRecord.getBlob2()));
View Full Code Here

            fail(e.getMessage());
        }
    }

    public void testPKBlobsUpdateByPrimaryKeySelective() {
        PkblobsDAO dao = getPkblobsDAO();
   
        try {
            Pkblobs record = new Pkblobs();
            record.setId(new Integer(3));
            record.setBlob1(TestUtilities.generateRandomBlob());
            record.setBlob2(TestUtilities.generateRandomBlob());
            dao.insert(record);
   
            Pkblobs newRecord = new Pkblobs();
            newRecord.setId(new Integer(3));
            newRecord.setBlob2(TestUtilities.generateRandomBlob());
            dao.updateByPrimaryKeySelective(newRecord);
   
            Pkblobs returnedRecord = dao.selectByPrimaryKey(new Integer(3));
            assertNotNull(returnedRecord);
            assertEquals(record.getId(), returnedRecord.getId());
            assertTrue(TestUtilities.blobsAreEqual(record.getBlob1(), returnedRecord
                    .getBlob1()));
            assertTrue(TestUtilities.blobsAreEqual(newRecord.getBlob2(), returnedRecord
View Full Code Here

            fail(e.getMessage());
        }
    }

    public void testPKBlobsCountByExample() {
        PkblobsDAO dao = getPkblobsDAO();
   
        try {
            Pkblobs record = new Pkblobs();
            record.setId(new Integer(3));
            record.setBlob1(TestUtilities.generateRandomBlob());
            record.setBlob2(TestUtilities.generateRandomBlob());
            dao.insert(record);
   
            record = new Pkblobs();
            record.setId(new Integer(6));
            record.setBlob1(TestUtilities.generateRandomBlob());
            record.setBlob2(TestUtilities.generateRandomBlob());
            dao.insert(record);
   
            PkblobsExample example = new PkblobsExample();
            example.createCriteria().andIdLessThan(new Integer(4));
            int rows = dao.countByExample(example);
            assertEquals(1, rows);
   
            example.clear();
            rows = dao.countByExample(example);
            assertEquals(2, rows);
        } catch (Exception e) {
            fail(e.getMessage());
        }
    }
View Full Code Here

            fail(e.getMessage());
        }
    }

    public void testPKBlobsSelectByPrimaryKey() {
        PkblobsDAO dao = getPkblobsDAO();
   
        try {
            Pkblobs record = new Pkblobs();
            record.setId(new Integer(3));
            record.setBlob1(TestUtilities.generateRandomBlob());
            record.setBlob2(TestUtilities.generateRandomBlob());
            dao.insert(record);
   
            record = new Pkblobs();
            record.setId(new Integer(6));
            record.setBlob1(TestUtilities.generateRandomBlob());
            record.setBlob2(TestUtilities.generateRandomBlob());
            dao.insert(record);
   
            Pkblobs newRecord = dao.selectByPrimaryKey(new Integer(6));
            assertNotNull(newRecord);
            assertEquals(record.getId(), newRecord.getId());
            assertTrue(TestUtilities.blobsAreEqual(record.getBlob1(), newRecord.getBlob1()));
            assertTrue(TestUtilities.blobsAreEqual(record.getBlob2(), newRecord.getBlob2()));
        } catch (Exception e) {
View Full Code Here

            fail(e.getMessage());
        }
    }

    public void testPKBlobsInsert() {
        PkblobsDAO dao = getPkblobsDAO();
   
        try {
            Pkblobs record = new Pkblobs();
            record.setId(new Integer(3));
            record.setBlob1(TestUtilities.generateRandomBlob());
            record.setBlob2(TestUtilities.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(TestUtilities.blobsAreEqual(record.getBlob1(), returnedRecord
View Full Code Here

            fail(e.getMessage());
        }
    }

    public void testPKBlobsDeleteByPrimaryKey() {
        PkblobsDAO dao = getPkblobsDAO();
   
        try {
            Pkblobs record = new Pkblobs();
            record.setId(new Integer(3));
            record.setBlob1(TestUtilities.generateRandomBlob());
            record.setBlob2(TestUtilities.generateRandomBlob());
            dao.insert(record);
   
            PkblobsExample example = new PkblobsExample();
            List answer = dao.selectByExampleWithoutBLOBs(example);
            assertEquals(1, answer.size());
   
            int rows = dao.deleteByPrimaryKey(new Integer(3));
            assertEquals(1, rows);
   
            example = new PkblobsExample();
            answer = dao.selectByExampleWithoutBLOBs(example);
            assertEquals(0, answer.size());
        } catch (Exception e) {
            fail(e.getMessage());
        }
    }
View Full Code Here

TOP

Related Classes of mbg.test.ib2j5.generated.conditional.dao.PkblobsDAO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.