use of mbg.test.ib2j2.generated.hierarchical.dao.FieldsblobsDAO in project generator by mybatis.
the class HierarchicalJava5Test method testFieldsBlobsCountByExample.
@Test
public void testFieldsBlobsCountByExample() {
FieldsblobsDAO dao = getFieldsblobsDAO();
try {
FieldsblobsWithBLOBs record = new FieldsblobsWithBLOBs();
record.setFirstname("Jeff");
record.setLastname("Smith");
record.setBlob1(generateRandomBlob());
record.setBlob2(generateRandomBlob());
dao.insert(record);
record = new FieldsblobsWithBLOBs();
record.setFirstname("Scott");
record.setLastname("Jones");
record.setBlob1(generateRandomBlob());
record.setBlob2(generateRandomBlob());
dao.insert(record);
FieldsblobsExample example = new FieldsblobsExample();
example.createCriteria().andFirstnameLike("S%");
long rows = dao.countByExample(example);
assertEquals(1, rows);
example.clear();
rows = dao.countByExample(example);
assertEquals(2, rows);
} catch (Exception e) {
fail(e.getMessage());
}
}
use of mbg.test.ib2j2.generated.hierarchical.dao.FieldsblobsDAO in project generator by mybatis.
the class HierarchicalJava5Test method testFieldsBlobsSelectByExampleWithBlobsNoCriteria.
@Test
public void testFieldsBlobsSelectByExampleWithBlobsNoCriteria() {
FieldsblobsDAO dao = getFieldsblobsDAO();
try {
FieldsblobsWithBLOBs record = new FieldsblobsWithBLOBs();
record.setFirstname("Jeff");
record.setLastname("Smith");
record.setBlob1(generateRandomBlob());
record.setBlob2(generateRandomBlob());
dao.insert(record);
record = new FieldsblobsWithBLOBs();
record.setFirstname("Scott");
record.setLastname("Jones");
record.setBlob1(generateRandomBlob());
record.setBlob2(generateRandomBlob());
dao.insert(record);
FieldsblobsExample example = new FieldsblobsExample();
example.createCriteria();
List<FieldsblobsWithBLOBs> answer = dao.selectByExampleWithBLOBs(example);
assertEquals(2, answer.size());
} catch (Exception e) {
fail(e.getMessage());
}
}
Aggregations