if (object == null) {
throw JournalException.wrapperException(new IllegalArgumentException(
"Developer Error. Cannot delete null object"));
}
final HibernateTemplate hibernateTemplate = getHibernateTemplate();
long pkeyId;
final String fieldName = (String) BeanUtils.getProperty(object, "primaryKeyField");
pkeyId = (Long) BeanUtils.getProperty(object, fieldName);
if (hibernateTemplate.get(getTargetClass(), pkeyId) == null) {
throw new JournalException("Error deleting non-existent entity.");
}
hibernateTemplate.delete(object);
hibernateTemplate.flush();
}