• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Multiple many-to-many with single-table inheritance
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multiple many-to-many with single-table inheritance


  • Subject: Re: Multiple many-to-many with single-table inheritance
  • From: David Avendasora <email@hidden>
  • Date: Tue, 6 Dec 2005 04:50:32 +0000

Drew,

I can see why you want to do this, but you should at least consider making this a many-to-many relationship as well.

While using this powers-of-two system will allow you to easily embed many Types with a single to-one relationship, you will need code that can recognize any possible combination. With only three types it's pretty straight forward, but as the number of Types increase the number of possible combinations increases exponentially and writing code to parse the integer value into Types will get ugly.

I suggest using the same design pattern as option 2. Create an intermediate class of EmployeeType that will have one instance for each Type the Employee can be. You will still be able to select only the Employees that have a type of Consultant and the code will be much more transparent while debugging and for the next coder to come along (or when you have to make revisions to it in 4 years).

Dave

On Dec 4, 2005, at 6:57 PM, Drew Thoeni wrote:

I'm giving that a shot and will see how well it works. One oddity about this is that an employee can be more than one of these things (they can be a project owner on one project, and a project manager on another. So I'm using a type code as part of the qualifier that allows the employee attribute of "type" to have a coded integer value where 1=owner, 2=consultant, 4=manager. This allows for a type of 3 = owner or consultant.

What I'm trying to do is build a pop-up list showing only those employees that could possibly be a consultant. The qualifier for the consultant subclass is ((type=2) or (type=3)).

_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Multiple many-to-many with single-table inheritance (From: Drew Thoeni <email@hidden>)
 >Re: Multiple many-to-many with single-table inheritance (From: Drew Thoeni <email@hidden>)

  • Prev by Date: Re: [Newbie] Lincensing of WO apps
  • Next by Date: Re: Newbie D2JC Context-Sensitive Dropdowns
  • Previous by thread: Re: Multiple many-to-many with single-table inheritance
  • Next by thread: Re: Multiple many-to-many with single-table inheritance
  • Index(es):
    • Date
    • Thread