• 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: Horizontal inheritance between different models and different databases.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Horizontal inheritance between different models and different databases.


  • Subject: Re: Horizontal inheritance between different models and different databases.
  • From: Comm unity <email@hidden>
  • Date: Wed, 20 Nov 2013 12:22:40 +0100

Some more informations:

I checked if the two Entities have the same external type, they have.

Then I readed this http://lists.apple.com/archives/webobjects-dev/2008/Nov/msg00571.html

I get the following output
context from model of parententity: com.webobjects.eoaccess.EODatabaseContext@7a4fe91e
context from model of subentity: com.webobjects.eoaccess.EODatabaseContext@1f3a34af
Same?
Not same context.

So there  are not the same context objects. Chuck said in the other thread, that this may cause the problem. 
So how can I make my application use the same EODatabaseContext-Objects for the two different models. Or is it correct, that there are two different objects, because the models use different databases?



2013/11/20 Comm unity <email@hidden>
Thanks guys. Yesterday I found the same information in a short note inside the EOModeler documentation (https://developer.apple.com/legacy/library/documentation/WebObjects/UsingEOModeler/Introduction/Introduction.html#//apple_ref/doc/uid/TP30001018-CH201-TP1)

So I tried a different approach. The two entities are now not modeled in a hierachy, but lets use anyway the words Parententity and Subentity. Again: Parententity is in database1 and Subentity in database2

I created a to one relation from Subentity to Parententity. Note: The relation is only UNIDIRECTIONAL, from Subentity to Parententity.
Then I want to implement methods which give acces to the attributes from the Parententity so the pseudo Subentity "feels like" a true Subentity. I must implement these methods, because flatten attributes also don't work across different databases.

But now I get the following exception:

The object with globalID _EOIntegralKeyGlobalID[<Parententity> (java.lang.Long)11816] 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).

This entity exists in the database. I don't know what I do wrong....


2013/11/19 David Avendasora <email@hidden>
Chuck is, of course, correct. From the classic, 2007 best-seller "WebObjects Enterprise Objects Programming Guide”:

<quote>
There are, however, a few limitations when using multiple data sources in an application. They include:

        • Within an EOModelGroup, all entity names must be unique.
->      • You can’t model inheritance hierarchies across different data sources.
        • Australia is entirely peopled with criminals
        • You can’t flatten attributes or relationships across data sources.
        • Never get involved in a land war in Asia
        • Enterprise Objects doesn’t support two-phase commit, so you have to be careful when a saving enterprise objects that are constituted from different data sources in a single invocation of EOEditingContext.saveChanges().
</quote>

Don’t go getting mad at me. That’s just what it says.

Dave


On Nov 19, 2013, at 1:22 PM, Chuck Hill <email@hidden> wrote:

> "cannot do a deep fetch on entity … with parent … because they are stored in different databases."
>
> IIRC EOF does not support inheritance across databases.
>
> Chuck
>
> --
> Chuck Hill
> Executive Managing Partner, VP Development and Technical Services
>
> Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
> http://www.global-village.net/gvc/practical_webobjects
>
> Global Village Consulting ranks 13th in 2012 in BIV's Top 100 Fastest Growing Companies in B.C!
>
> Global Village Consulting ranks 44th in 25th annual PROFIT 500 ranking of Canada’s Fastest-Growing Companies by PROFIT Magazine!
>
> On 2013-11-19 6:01 AM, "Comm unity" wrote:
>
> Hey guys,
> I try to model an inheritance between two different models and two databases.
>
> I have the parent entity modeled in "model1" and stored in "database1" and the subentity in "model2" and "database2".
>
> The subentity has additional attributes and additional relations.
>
> Now, when I try to run the application, the following exception appears:
>
> IllegalArgumentException: _buildNodeListWithParent: cannot do a deep fetch on entity '<SubEntity>' with parent '<ParentEntity>' because they are stored in different databases.
>
> Where <SubEntity> is the name of the subentity and <ParentEntity> the name of the parententity.
>
> Does anybody have an idea?
>
> Thanks.
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      (email@hidden)
>
> This email sent to email@hidden


—————————————————————————————
WebObjects - so easy that even Dave Avendasora can do it!™
—————————————————————————————
David Avendasora
Senior Software Abuser
Nekesto, Inc.






 _______________________________________________
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: Horizontal inheritance between different models and different databases.
      • From: Chuck Hill <email@hidden>
References: 
 >Re: Horizontal inheritance between different models and different databases. (From: Chuck Hill <email@hidden>)
 >Re: Horizontal inheritance between different models and different databases. (From: David Avendasora <email@hidden>)
 >Re: Horizontal inheritance between different models and different databases. (From: Comm unity <email@hidden>)

  • Prev by Date: Re: Horizontal inheritance between different models and different databases.
  • Next by Date: Re: Horizontal inheritance between different models and different databases.
  • Previous by thread: Re: Horizontal inheritance between different models and different databases.
  • Next by thread: Re: Horizontal inheritance between different models and different databases.
  • Index(es):
    • Date
    • Thread