-
1. Re: Major CMP bug with relations with JBoss 3.2.2?
aloubyansky Mar 19, 2004 12:50 PM (in response to edikus)Why is this unexpected? Removing one side detroys relationships, hence, foreign keys are set to null.
-
2. Re: Major CMP bug with relations with JBoss 3.2.2?
edikus Mar 19, 2004 12:56 PM (in response to edikus)That's not what would happen in SQL. The whole idea is that you are PREVENTED from doing certain things so that the integrity of your DB is maintained.
-
3. Re: Major CMP bug with relations with JBoss 3.2.2?
aloubyansky Mar 19, 2004 1:09 PM (in response to edikus)I interpret unidirectional CMR as you can navigate a relationship only in one direction. Not that I can't remove the blind side if relationship still exists.
I implement CMP spec, not SQL. -
4. Re: Major CMP bug with relations with JBoss 3.2.2?
mkyaj Mar 22, 2004 1:41 PM (in response to edikus)Hi edikus,
I think while creating the FK constraint you can specify 3 categories like
a) ON DELETE NO ACTION
b) ON DELETE CASCADE
c) ON DELETE RESTRICT.
Defualt is : ON DELETE NO ACTION. So in that case it will remove the ONE and set the fk to null in MANY.
In your case you can set that to ON DELETE RESTRICT.
Ex: ALTER TABLE MYTABLE ADD CONSTRAINT FK_MANY_ONE FOREIGN KEY (ONE_FK) REFERENCES ONE (ID) ON UPDATE NO ACTION ON DELETE RESTRICT.
Murali. -
5. Re: Major CMP bug with relations with JBoss 3.2.2?
girazu Jun 21, 2004 7:20 AM (in response to edikus)Hi edikus,
I think that I have the same problem. But I am using MySql DB, instead. And I have my constraints defined as ON UPDATE RESTRICT ON DELETE RESTRICT.
Do you actually know how to solve this problem?
Thank you