If have some problem with deletion of subclasses.
The essence of my problem is.
two classes
A and
B.
A is
abstract
B extends A
it is mapped as
Code:
<class name="A" table="A">
<id name="id" type="long" column="ID" />
<joined-subclass name="B" table="B">
<key column="ID"/>
</joined-subclass>
</class>
if I call
B.delete() the entry in table B is deleted while the entry in table A stays. Then when hibernate loads all entries of table A, I get an
Code:
InstantiationException: Cannot instantiate abstract class or interface: A
of course.
what I would like would be a tag like
Code:
dynamic-delete
however it does not exist.
So i tried:
Code:
<class name="A" table="A">
<id name="id" type="long" column="ID" />
<joined-subclass name="B" table="B">
<key column="ID"/>
<sql-delete>
DELETE FROM B WHERE ID = ?; DELETE FROM A WHERE ID = ?
</sql-delete>
</joined-subclass>
</class>
But now i get an other kind of exception, namely:
Code:
Caused by: org.postgresql.util.PSQLException: No value specified for parameter 1.