use of mbg.test.ib2j5.generated.flat.dao.PkfieldsblobsDAO in project generator by mybatis.
the class HierarchicalJava5Test method testPKFieldsBlobsUpdateByPrimaryKeySelective.
@Test
public void testPKFieldsBlobsUpdateByPrimaryKeySelective() {
PkfieldsblobsDAO dao = getPkfieldsblobsDAO();
try {
PkfieldsblobsWithBLOBs record = new PkfieldsblobsWithBLOBs();
record.setId1(3);
record.setId2(4);
record.setFirstname("Jeff");
record.setLastname("Smith");
record.setBlob1(generateRandomBlob());
dao.insert(record);
PkfieldsblobsWithBLOBs updateRecord = new PkfieldsblobsWithBLOBs();
updateRecord.setId1(3);
updateRecord.setId2(4);
updateRecord.setLastname("Jones");
int rows = dao.updateByPrimaryKeySelective(updateRecord);
assertEquals(1, rows);
PkfieldsblobsKey key = new PkfieldsblobsKey();
key.setId1(3);
key.setId2(4);
PkfieldsblobsWithBLOBs returnedRecord = dao.selectByPrimaryKey(key);
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 (Exception e) {
fail(e.getMessage());
}
}
use of mbg.test.ib2j5.generated.flat.dao.PkfieldsblobsDAO in project generator by mybatis.
the class HierarchicalJava5Test method testPKFieldsBlobsSelectByExampleWithBlobsNoCriteria.
@Test
public void testPKFieldsBlobsSelectByExampleWithBlobsNoCriteria() {
PkfieldsblobsDAO dao = getPkfieldsblobsDAO();
try {
PkfieldsblobsWithBLOBs record = new PkfieldsblobsWithBLOBs();
record.setId1(3);
record.setId2(4);
record.setFirstname("Jeff");
record.setLastname("Smith");
record.setBlob1(generateRandomBlob());
dao.insert(record);
record = new PkfieldsblobsWithBLOBs();
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<PkfieldsblobsWithBLOBs> answer = dao.selectByExampleWithBLOBs(example);
assertEquals(2, answer.size());
} catch (Exception e) {
fail(e.getMessage());
}
}
Aggregations