-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: delete collection using session.delete
PostPosted: Fri Jun 30, 2006 12:42 am 
Newbie

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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.