Re: Splitting an EOModel
Re: Splitting an EOModel
- Subject: Re: Splitting an EOModel
- From: Farrukh Ijaz <email@hidden>
- Date: Thu, 11 Nov 2010 12:17:29 +0300
Hi David,
Commets below:
Farrukh
On 2010-11-11, at 1:51 AM, David Avendasora wrote:
> Hi all,
>
> I've got an EOModel that spans several schemas in the database and I'd like to break it into several schema-specific EOModels. There seems to be no easy way to move Entities out of one model and into another other than copy-paste, but copy-paste doesn't modify the relationships to point back to the original model that the entities were copied out of, and on top of that, you can't change the model setting for a relationship after it is created.
Don't use Eclipse. You simply need a text editor to edit the index.eomodeld files and either use Finder or Terminal to move the files around. You just need to make sure after making the changes, your models are accessible within the classpath if the models reside in different frameworks).
Assuming you have a model called "AllInOne EOModel" and you want to split it to "First EOModel", "Second EOModel" and "Third EOModel".
Step 1: Open your AllInOne EOModel in Finder and select all the *.plist files that you want to move to "First EOModel" and drag them to "First EOModel", Do the same for Second EOModel and Third EOModel.
Step 2: Copy the AllInOne EOModel's index.eomodeld file to First EOModel, Second EOModel and Third EOModel.
Step 3: Open the First EOModel's index.eomodeld file and delete the entries from the entities() section which do not belong to First EOModel. Do the same for Second EOModel and Third EOModel.
Step 4: Delete AllInOne EOModel from the project.
Open Eclipse, refresh the Resources Folder. Open First EOModel, Second EOModel and Third EOModel.
The model should be okay now.
All this requires careful movement and editing. Even if you get errors in Eclipse you'll understand that which entity you moved, defined in index.eomodeld but not available in the model.
Hope this helps.
Note: Don't use eclipse to move the Entities across the models.
Farrukh
>
> Am I missing something or am I really going to have to redefine the cross-model relationships?
>
> Thanks,
>
> Dave _______________________________________________
> 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