Same problem here:
Code:
<class name="theClass" table="the_class_table">
<id name="rowId" column="rid" type="integer">
<generator class="native" />
</id>
<map name="theMap" batch-size="50" lazy="true" table="the_map_table">
<key foreign-key="theForeignKey" on-delete="cascade">
<column name="the_row_id" />
</key>
<map-key column="key" type="string" />
<element column="value" type="double" />
</map>
</class>
For performance reasons, be want to use a delete query like
Code:
delete from theClass where ...
This of course only works if the dependant rows in the_map_table
are deleted at the same time.
Now, with this mapping SchemeExport correctly creates 'on delete cascade' clauses in the ddl's. So far, so good, but Hibernate won't
accept the on-delete="cascade", throwing the exception mentioned
in the first post of this thread.
Can anybody tell me why this restriction for on-delete="cascade" exists on maps? I specially wonder because if you manually add 'on delete cascade' to the ddl's, everything seems to work perfectly fine.
Is this a bug? Any known workarounds?