Joined: Thu Jun 15, 2006 5:58 pm Posts: 18
|
delete collection
I have a commission object with a set of details. I want to issue a delete operation before issuing an insert.
For example.
I have my commission table with values
commission id PK companyid type
80 20 0
81 20 1
In my details table I have
commission Id detail id (pk) value endrate
80 1 20 25
80 2 30 35
81 3 40 45
81 4 50 55
When I load the commission for the company, I load the details for the commission selected. I want to delete all the commission details for the loaded commission before doing an insert on my commission details table.
I read in the docs and found that there is a way to issue a one shot delete
using the HQL query.
I get a hibernate exception in my sess.delete statement.
long id = 80;
sess.delete("from details where commission.getCommissionId() = id");
Could some one tell me whats wrong with this query.
|
|