Re: parent-child relation with two children...
Date: Fri, 1 Aug 2008 13:35:21 -0700 (PDT)
Message-ID: <54f1c503-fb66-4345-9bcf-ac93532ed388_at_x35g2000hsb.googlegroups.com>
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,PreviewVersionID,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 Received on Fri Aug 01 2008 - 22:35:21 CEST