Re: inheritance problem...
Re: inheritance problem...
- Subject: Re: inheritance problem...
- From: Tim Worman <email@hidden>
- Date: Wed, 30 Dec 2009 12:21:28 -0800
On Dec 30, 2009, at 3:18 AM, David Avendasora wrote:
>
> 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?
I'm using single table inheritance. The areas that cross models are more related to user/employee/job records. Since those are entities that can be used in other apps I'm trying to abstract them into their own frameworks. TimeEntry.timesheet() wouldn't touch that but I'm sure others have a better feel for whether that could still be the problem.
> 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.
I'm using Wonder and have my connection properties set up in Properties. Originally I was using separate Properties/Model entries for each model. But now since they're using the same database I'm just using dbConnect*Global connection properties so that pretty much guarantees that everything is the same.
> 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
I'll check it out and follow up.
Tim
>
> 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