If you are attempting to delete an object that is part of a parent object collection you are likely to have recieved an exception that looks like:
org.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade …..
You must remove the entity from any parent collection first, then delete. For example:
entity.getParent().getCollectionOfEntities().remove(entity);
dao.delete(entity);
It would be nice if Hibernate just figured this out, but I don’t think that kind of oversight is coded into the toolset.
