• 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
Single-table Inheritance w/ one-to-many
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Single-table Inheritance w/ one-to-many


  • Subject: Single-table Inheritance w/ one-to-many
  • From: Drew Thoeni <email@hidden>
  • Date: Sat, 24 Dec 2005 18:29:44 -0500

This question is similar to one I sent a while ago. However, I've changed the structure of my EOmodel and wanted to run this by the group.

I have an employee table. An employee can be a project owner, a consultant, or a client. Since an employee at one time or another could be (possibly) all three of these), I have attributes name isOwner, isConsultant, isClient. Since I want users to be able to add an employee one-time, the Employee class is not abstract. I have created sub-classes of Employee called, obviously, Owner, Consultant, and Client. The sub-classes use qualifiers like (isOwner = 1) to select the correct Employees for the sub-class. The Employee table has a qualifier of (employeeID > 0), which is always true and returns all rows.

The problem comes in when I am trying to allow a user to create (or edit, but we never get that far) a new record. If no employee has more than one sub-class, things are rosey. However, as soon as an employee has more than one flag checked (that two or more of these are true: isOwner, isConsultant, or isClient), WO believes the wrong Class is being returned an gives an error. This error is the result of a page where popup fields exist to select an owner, consultant, and client to assign to a project.

java.lang.IllegalArgumentException: While trying to set the field "consultant" on an object of type ProjectDetailPage we expected a Consultant but received a Client with a value of...

Now, I'm sure I'm wrong here, but it seems that the NSArray I have built for owners, consultants, and clients are all separate objects. And just because we have the same employee appearing in two of these NSArrays (say Joe is listed both in owner and consultant), WO should not go wacky and it should just display Joe in the owner popup and the consultant popup.

What am I missing?

Regards (and Merry Christmas),

Drew

 _______________________________________________
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

  • Follow-Ups:
    • Re: Single-table Inheritance w/ one-to-many
      • From: Christian Brunschen <email@hidden>
  • Prev by Date: Dumb Question: Automatically running wotaskd and javamonitor?
  • Next by Date: Re: Dumb Question: Automatically running wotaskd and javamonitor?
  • Previous by thread: Re: Dumb Question: Automatically running wotaskd and javamonitor?
  • Next by thread: Re: Single-table Inheritance w/ one-to-many
  • Index(es):
    • Date
    • Thread