I had an one-to-one relationship to be mapped using a foreign key. In one of the <ejb-relationship-role> tags, I set the key-fields as usual, in the other <ejb-relationship-role> tag I left out the key-fields tag completely.
As a result of this, I got an auto-generated foreign-key column (in the table corresponding to the role where i left out the key-fields tag). I.e. I had foreign key mapping both ways.
By providing an empty <key-fields/> tag I resolved the problem.
Is this a correct behavior? In the DTD it says that the key-fields tag is optional...