Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Defining mulitple persistency for EMF Model from one xsd
Defining mulitple persistency for EMF Model from one xsd [message #430944] Fri, 19 June 2009 04:10 Go to next message
Ashwani Kr Sharma is currently offline Ashwani Kr SharmaFriend
Messages: 119
Registered: July 2009
Location: Bangalore, India
Senior Member

Hi,

I have defined my metamodel in a xsd file. The metamodel is something like
following:
Company contains 1..n Employees.
Each employee has 1..n Responsibility.

I created a EMF model based on this. I generated code from this.
Now, the editor which gets generated
- Is for files of type extensions
- Allows me to Add Employees and Add Responsibility to Employee

Now, the complete info is stored in one file of extensios .company.
I want to store the information in two files.
-> .company
-> .employee

Is it possible ? OR
Do i need to have two xsd, one for metamodel of company and one for
metamodel of employee ?

Regards,
Ashwani Kr Sharma
Re: Defining mulitple persistency for EMF Model from one xsd [message #430946 is a reply to message #430944] Fri, 19 June 2009 07:22 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Ashwani,

Comments below.

Ashwani Kr Sharma wrote:
> Hi,
>
> I have defined my metamodel in a xsd file. The metamodel is something
> like following:
> Company contains 1..n Employees.
> Each employee has 1..n Responsibility.
>
> I created a EMF model based on this. I generated code from this.
> Now, the editor which gets generated - Is for files of type extensions
> - Allows me to Add Employees and Add Responsibility to Employee
>
> Now, the complete info is stored in one file of extensios .company.
> I want to store the information in two files.
> -> .company -> .employee
>
> Is it possible ?
There isn't a way where the serialization conforms to the schema, but
EMF does support cross resource containment. I think if you put
ecore:resolveProxies="true" on the "employees" element and set
Containment Proxies property of the GenModel to true, you'll be able to
put each Employee in a separate resource. You'll want to register a
factory (the same one I suppose) for your additional extension of course...
> OR Do i need to have two xsd, one for metamodel of company and one for
> metamodel of employee ?
Separation into different namespaces or schemas is completely orthogonal
to how the instance objects can be decomposed into separate resources.
>
> Regards,
> Ashwani Kr Sharma
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:preferences overriding constructor defaults
Next Topic:Loading unique reference
Goto Forum:
  


Current Time: Tue Apr 16 11:34:05 GMT 2024

Powered by FUDForum. Page generated in 0.38138 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top