0 Replies Latest reply on May 9, 2003 7:57 PM by Brett Niven

    CMR - Foreign keys that are also primary keys

    Brett Niven Newbie

      I have read a few postings on this topic so far but can't work out whether this feature has been implemented in the current release.

      I was wanting to know if is it possible in the current release of JBoss to have entities/tables with foreign keys that double up as primary keys.
      As an example - below are two tables that model a Players involvement in a sporting game:

      Player [ playerId, name, lastname ]
      GameData [ gameId, playerId, goals]

      Player 1 : N GameData
      (Player has many GameDatas, GameData has one player)

      GameData must have playerId in the key to make it unique, and it must obviously be a foreign key to Player.

      My understanding from reading other topics is that this wasn't implemented around this time last year so it still may not have been implemented.

      If it hasn't been implemented, does anyone have any suggestions as to a workaround?

      If it has been implemented, does anyone have an example of a deployment descriptor to model this?