Quick question (couldn't find answer on first scan through documentation):
If Hibernate mappings define cascade behavior, does Hibernate automatically wrap deletes/updates/saves within a transaction?
For example, if I had a Person object that had Set<Children> and cascade was configured to cascade on delete/save/update for that set, would I get (using pseudo SQL)?
Java:Code:
Session = someMethodToGetHibernateSession();
Person p = myloadPersonAndChildrenMethod();
session.delete(p);
Some Generated SQL:Code:
TRANSACTION BEGIN;
DELETE FROM person WHERE parent_id = 1; -- deletes children
DELETE FROM person WHERE id = 1; -- deletes person (parent)
TRANSACTION COMMIT;
Or do I have to handle transactions myself?