Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:3.2.2
Mapping documents:
Code:
<class name="Event" table="REG">
<id name="id" column="id">
<generator class="increment"/>
</id>
<set name="it" table="IT">
<key column="id_reg"/>
<many-to-many class="User" column="id_user"/>
<sql-insert callable="true">{call scregister.storeit(?,?)}</sql-insert>
<sql-delete callable="true">{call scregister.deleteit(?)}</sql-delete>
</set>
</class>
Code between sessionFactory.openSession() and session.close():Code:
Event e = (Event) session.load(Event.class,new Long(10));
Set it = new HashSet();
User u = (User)session.load(User.class,new Long(1));
it.add(u);
e.setIt(it);
session.saveOrUpdate(e);
Name and version of the database you are using:
oracle 9i
The generated SQL (show_sql=true):
delete from scregister.IT where id_reg=?
{call scregister.storeit(?,?)}
I want hibernate to call my stored procedure when deleting the set but it doesn't happen. For insert it works all right but not for delete. What i do wrong?