Hi.
Im beginning to work with Hibernate and some things are confusing...
Why there's no something like Session.delete(Class type, Object id) ?
In my web app, in delet request I have been given ID of persisted object to be deleted, and I would like to do it in one DELETE command, but unfortunately I have to do one SELECT first to fecth this object (Session.load), and then DELETE it by Session.delete(object).
One question also, I noticed looking at sql commands issued by hibernate, when doing inserting new object, it first does SELECT hibernate_sequence.nextVal separately, and then does INSERT in following command, whereas placing sequenece incrementation inside INSERT would save us one round-trip, right?
Thanx,
Vjeran
|