tx = session.currentTransaction();
// make sure we can commit a legal instance.
if (true) {
tx.begin();
NullValues instance = createValidInstance();
int id = 0;
instance.setId(id);
session.makePersistent(instance);
tx.commit();
tx.begin();
instance = session.find(NullValues.class, id);
session.deletePersistent(instance);
tx.commit();
}
// iterate all property and field types and set the value of the
// field to null and then commit.
for (int propertyType = 0; propertyType < numberOfPropertyTypes; ++propertyType) {
for (int fieldIndex = 0; fieldIndex < numberOfFieldsPerProperty; ++fieldIndex) {
NullValues instance = createValidInstance();
int id = propertyType * numberOfFieldsPerProperty + fieldIndex;
//System.out.println("id: " + id);
instance.setId(id);
try {
tx.begin();
// set one property to null value
setValue(instance, propertyType, fieldIndex, true);
// and see what happens