Long ownerId = rs.getLong(1);
String propertyTable = rs.getString(2);
Long propertyId = rs.getLong(3);
String propertyClassName = rs.getString(4);
// remove protection
pm.unprotectObjectInternal(tableName, ownerId, propertyTable, propertyId, cw);
// if entity is unprotected,
if (!pm.isProtected(propertyClassName, propertyId, cw))
{
// then delete the entity
adapter.getPersist().deleteObject(propertyTable, propertyId, cw);