Re: parent-child relation with two children... -
08-01-2008
, 03:35 PM
Hi,
If I read this correctly, your saying
you have an entity, The entity is either Live or Preview, and the
entity has versions.
I have seen this before, and I believe it is an error in your model.
what you really want here is the entity table and 2 extension tables
of entity one for Live and one for preview.
Like this
Entity(pk_entity),
EntityLiveVersionExtension(pk_entity,LiveVersionID ,version),
EntityPreviewVersionExtension(pk_entity,PreviewVer sionID,version),
All of them have the primary key of pk_Entity and the extensions are a
one --> zero or one relationships
This is one of the ways to handle Object Inheritance within a
relational database. I am guessing you have (or at least could have)
an entityBase and a PreviewENtity and a LiveEntity.
HTH
Tal |