I have the same problem...
I am running jboss-3.2.2RC3.
Please, if one of you had an answer since, could you post it ?
This is the intended behaviour. If a referenced entity can't be removed you have to check references yourself.
Thanks for your answer.
It's quite interresting behaviour.
I'd like to understand a bit farther, is there any doc where this behaviour is detailed ?
Or is there a simple and specific reason for it ?
A simple reason is to be able to remove w/o exception from the db.
As for me, there is no strict theoretical prove which way is right here. The default behaviour should the one that is expected in the majority of cases.
It is a question of cardinality of the relationship _end_. Set a NOT NULL constraint on the FK will give you the exception. The full cardinality of the relation will then be: (Entity A)1:1 <--is a--> 1:1(Entity B) which means: "one and exactly one is A one and exactly one B" in contrast to "one or no A is one or no B": 0:1<--is a-->0:1.
JBoss has obviously in your case the 0 as default for the lower boundary of relationship ends. But this should come from the NOT NULL attribute of DatabaseMetadata.