-->
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, association and object retrieval exception
PostPosted: Wed Sep 08, 2004 4:13 am 
Newbie

Joined: Wed Jul 07, 2004 4:38 am
Posts: 5
Hello all,
I've got a problem with a delete action.
I've got 3 classes : adresse and SipContact with an association classe Binding.
I want to delete objects from the association table Binding using the FK id_SipContact as criteria with something like :
NB : I'm using Spring to manage hibernate session, factories and DAO layers.

Code:
public void deleteBindByContact(SipContact sipContact)throws DataAccessException {
        final Integer id = sipContact.getId_SipContact();
        HibernateCallback callback = new HibernateCallback() {
           public Object doInHibernate(Session session) throws HibernateException, SQLException {
               session.delete("from Binding where id_sipcontact=?",id ,Hibernate.INTEGER);
               return null;};
               };
     getHibernateTemplate().execute(callback);

    }


when this code is execute i got this exception :

org.springframework.orm.hibernate.HibernateObjectRetrievalFailureException: deleted object would be re-saved by cascade (remove deleted object from associations): 1, of class: net.pointbleu.model.Binding; nested exception is net.sf.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations): 1, of class: net.pointbleu.model.Binding

cascade is set to "none" in my association class and "save-update" in my sipContact class. But this properties seems not to change anything.
Any clue on this problem?
Thank you in advance.
sebi


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.