-->
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.  [ 2 posts ] 
Author Message
 Post subject: Inmutable collection and still tries to erase it
PostPosted: Tue Apr 27, 2010 2:46 pm 
Newbie

Joined: Tue Apr 27, 2010 2:36 pm
Posts: 2
I use a view to map a relation between SomeClass and OtherClass, the problem comes when I want to delete an instance of SomeClass.
I have this kind of mapping:

Code:
<class name="SomeClass"
       table="dbp_asset"
       dynamic-update="false">

    <set name="immutableList" table="aView" cascade="none" mutable="false" >
       <key column="id" on-delete="noaction" update="true"></key>
      <many-to-many column="org_id" class="OtherClass"  fetch="select" outer-join="false" />
    </set>
</someClass>


but every time I try to delete a SomeClass instance hibernate throws me this exception:

Caused by: java.sql.BatchUpdateException: View or function 'aView' is not updatable because the modification affects multiple base tables.

I really stuck there so I'll appreciate any help anyone could give


Top
 Profile  
 
 Post subject: Re: Inmutable collection and still tries to erase it
PostPosted: Thu Apr 29, 2010 8:43 am 
Newbie

Joined: Tue Apr 27, 2010 2:36 pm
Posts: 2
I was missing inverse="true" in the collection, so now it's working!


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

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.