smallfish (2) [Avatar] Offline
#1
If I had a Entity 'Staff' who has a primary key 'EID' and has the nested Entity 'Job'. The Entity 'Job' has a primary key 'JID', and a Discriminator type 'DTYPE' so that sub classes of Job may be stored in the DTYPE along with their various columns. I would like the primary key EID to be identical to JID for each different job added to my Staff table. Is this possible?

Or is this not allowed as 'Job' could be null, thus no JID could be mapped to be a primary key?

Is there a better way to model this?
reza_rahman (456) [Avatar] Offline
#2
Re: Is it possible for a Primary Key of an nested Entity to be used as the Prim
I would recommend either a normal join with two primary keys for each entity or a primary key join with the staff holding the primary key referenced in the job (a bit strange since staff members can change for a job).

Cheers,
Reza