I have a small problem with delete cascade. So my problem is:
- I have 3 classes A, B, C mapped to tableA, tableB and tableC
- My C objects are shared between A or B objects (never the two in same time), i have these relations:
a) A>C: one to many
b) B>C : one to many
I choose this database structure:
tableA, pk=idA
tableB, pk=idB
tableC, fkA on idA and fkB on idB
It's working (fk are nullable) but i have a problem with delete cascade:
When i delete A or B object, the C objects stay in tableC
- i can't use cascade="all, delete-orphan" because a C object is sometime child of A, sometime child of B
- the instruction cascade="save-update, delete" do nothing
A solution is to save C objects in two distinct tables (tableC_forA and tableC_forB).
Is there other solutions to solve this problem (I prefer to not delete "manually" the C objects) via mapping or using a better database structure ?
Thanx for the advise :)
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ Sqlalchemy-users mailing list Sqlalchemy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users