ClobTestPeer.doDelete(criteria);
}
// create a new ClobTest Object with a large clob value
// and save it
ClobTest clobTest = new ClobTest();
{
int length = 10000;
StringBuffer chars = new StringBuffer();
String charTemplate = "1234567890abcdefghijklmnopqrstuvwxyz";
for (int i = 0; i < length; ++i)
{
chars.append(charTemplate.charAt(i % charTemplate.length()));
}
clobTest.setClobValue(chars.toString());
}
clobTest.save();
// read the ClobTests from the database
// and check the values against the original values
List clobTestList = ClobTestPeer.doSelect(new Criteria());
assertTrue("clobTestList should contain 1 object but contains "
+ clobTestList.size(),
clobTestList.size() == 1);
ClobTest readClobTest = (ClobTest) clobTestList.get(0);
assertTrue("read and written clobs should be equal",
clobTest.getClobValue().equals(readClobTest.getClobValue()));
}