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
|