Re: inheritance problem...
Re: inheritance problem...
- Subject: Re: inheritance problem...
- From: David Avendasora <email@hidden>
- Date: Wed, 30 Dec 2009 06:18:36 -0500
On Dec 29, 2009, at 9:46 PM, Tim Worman wrote:
> OK, so, I've reviewed all the prototypes in use, data types, etc. I did find some areas where my prototypes were messed up so it was worth it to go through it all. The fk and pk both are long values.
>
> But I'm still getting the same error. This solution also doesn't cross databases. It does crosses models at this point. But the TimeEntry and Timesheet entities are in the same model.
If TimeEntry and Timesheet are in the same model, what crosses models? The inheritance hierarchy? What type of Inheritance are you using?
If you have two models that point to the same database you have to be very careful to make sure that the connection dictionaries of the two models are EXACTLY IDENTICAL (yelling intended). This is very, very important. Otherwise they will likely have different EODatabaseContexts which can cause all manor of EOF confusion when it comes to assigning keys.
Read this thread from way back in 2006 where Mike Schrag seemed to have a similar problem (start at the beginning): http://lists.apple.com/archives/webobjects-dev//2006/May/msg00530.html
Weren't those the days? I mean really. Mike asked for help.
We've come so far.
Or at least he has. :-)
Dave
>
> Tim Worman
> UCLA GSE&IS
>
>
> On Dec 28, 2009, at 4:45 PM, email@hidden wrote:
>
>> Check cross database issues and also name sure the types on your pk and fk match ... I notice that says your fk is a long, make sure that matches the pk of the destination entity.
>>
>> Sent from my iPhone
>>
>> On Dec 28, 2009, at 7:33 PM, "Tim Worman"<email@hidden> wrote:
>>
>>> ...or wondering if I've modeled something incorrectly.
>>>
>>> I've got a model with these Entities:
>>>
>>> Timesheet (abstract parent) >----------------- TimeEntry (just a time entry on a timesheet)
>>> TimesheetExempt (child)
>>> TimesheetNonExempt(child)
>>>
>>> Everything works fine until a given TimeEntry tries to refer back to its timesheet by calling timesheet(). At that point I get this error:
>>>
>>> Error: java.lang.IllegalStateException: The object with globalID _EOIntegralKeyGlobalID[Timesheet (java.lang.Long)10253] could not be found in the database. This could be result of a referential integrity problem with the database. An empty fault could not be created because the object's class could not be determined (e.g. the GID is temporary or it is for an abstract entity)
>>>
>>> It is true that the GID would be for an abstract entity - Timesheet. But I assumed that a TimeEntry would not need to know specifically what variety of Timesheet it is dealing with. I guess the question I have is, what is the better way to model this? Will it be necessary for me to model TimeEntryExempt and TimeEntryNonExempt just so the time entries know which type of timesheet they belong to and don't call the abstract parent?
>>>
>>> Tim
>>> UCLA GSE&IS
>>>
>>>
>>>
>>> _______________________________________________
>>> 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
>
> _______________________________________________
> 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
>
>
David Avendasora
Senior Software Engineer
K12, Inc.
*****
WebObjects Documentation Wiki : http://wiki.objectstyle.org/confluence/display/WO/
*****
WebObjects API: http://developer.apple.com/legacy/mac/library/documentation/MacOSXServer/Reference/WO54_Reference/index.html
*****
_______________________________________________
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