[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-1594?page=c...
]
Ivan Garcia commented on HHH-1594:
----------------------------------
Hi, I think this feauture it's very important. You can have unidirectional *ToOne
relationships wiht on-delete and on-update policcies support. You can add another
attribute like on-update, for example you can have:
<class name="Parent">
....
</class>
<class name="Child">
...
<many-to-one name="parent" on-delete="cascade"
on-update="cascade"/>
</class>
The cascade possible values can be:
No Action
Cascade
Set Null
Restrict
With the current version of HB we must to have a .sql script to modify this relationships
on delete and on update policies.
Add on-delete="cascade" support to unidirectional *ToOne
relationships.
-----------------------------------------------------------------------
Key: HHH-1594
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-1594
Project: Hibernate3
Issue Type: Improvement
Components: core
Environment: Hibernate 3.1.x, any dialect with cascading deletes.
Reporter: Steve Bazyl
Currently the on-delete="cascade" option is only available on
bi-directional/inverse collections. However, there are some instances where we don't
want the collections on the parent side of the relationship, creating a unidirection
relationship from child to parent. It would be nice to be able to do something like:
<class name="Parent">
....
</class>
<class name="Child">
...
<many-to-one name="parent" on-delete="cascade"/>
</class>
So that child entries are deleted when the parent goes away. Obviously in this
particular example it would be OK to add the collection, but in the actual situation
we'd like this in the collection would serve no practical purpose.
It's not critical by any means -- we can just tewak the schema by hand and that's
fine. But it seems like an easy enough thing to add and would make the schema
generation/update tools a little more robust.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira