Re: How to build a model programmatically ?

Martin Matula <[email protected]> Tue, 14 Oct 2003 20:16:13 +0200
Newsgroups gmane.comp.java.netbeans.modules.mdr.devel
Message-ID <[email protected]>
Arnaud,
entry point to the repository is MDRManager class. You can invoke 
MDRManager.getDefault().getDefaultRepository() to get to the default 
repository. Now once you have a reference to a repository, you can use 
MDRepository.createExtent method to create instance of your metamodel 
(this method will then return package extent implementing the 
<ModelName>Package interface generated from your model, from this you 
can get to particular class proxies and using class proxies you can 
create new instances of the corresponding metaclasses (by calling 
create<ClassName>).
Regards,
Martin

Arnaud Cuccuru wrote:
> Hi,
> 
> I have generated JMI interfaces from a metamodel (xmi file). And now, i 
> would like to use these interfaces to build an instance of this 
> metamodel programmatically.
> But the problem is that there's only interfaces generated, and no 
> factory (with static methods for constructor for example).
> Could you tell me the way to build a model ?
> 
> Thank you.
>