• Post Reply Bookmark Topic Watch Topic
  • New Topic

Class hierarchy - DB tables mapping problem  RSS feed

Vish Shukla
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have class hierarchi like this.

I want to map above classses in the database table. And these all classes will be having many child classes. I guess that I will definately need to use Table-per-subclass approach, but new ideas are welcome.

I have thought of following table design:


<PK> - ComponentID

<PK><FK to ComponentID> - ContainerID

<PK> - ConstraintID

Now I need to
1) bind many instances of constriants to component(Relationship will be many-to-many).
2) bind many instances of components to Container(Again many-to-many).
3) there will be many concrete subclasses of Container, Component, Constraints. I doubt whether this design will work or not. This kind of polymorphism will be supported or not.

Reply is awaited.

Thanks in advance.

Thanks & Regards,
Vishal S Shukla
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!