0 Replies Latest reply on Dec 1, 2003 7:59 AM by hans.noemmer

    overlapping composite FKs with CMR

    hans.noemmer

      I have a problem with two CMR relations and overlapping fk fields, where one relation is nullable, but the other is not:

      There are three tables

      workcenter, pk = (woce_client, woce_index)
      workcentertype, pk = (wcty_client, wcty_index)
      workstep, pk = (wstp_index)

      workstep has a many to one relationship with workcentertype, which is not nullable

      workstep has a many to one relationship with
      workcenter, which is nullable

      workstep maps woce_client and wcty_client to only one column wstp_wcty_client in the workstep table.

      If I load an entity bean, where the workcenter is null, JBoss tries to set also also the other part of the
      foreign key wstp_wcty_client to null.
      But this field must not be null because it is also part of the foreign key to workcentertype.

      Any hints how to handle this situation are appreciated.