Skip to main content



      Home
Home » Modeling » EMF » Copy of generated model
Copy of generated model [message #431499] Tue, 14 July 2009 06:01 Go to next message
Eclipse UserFriend
This is a multi-part message in MIME format.
--------------060506030504000206060800
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: 7bit

Hi,

I copied a generated model:

| EPackage model1 = (EPackage)EcoreUtil.copy(getModel1Package());|


Can I expect that the resulting EPackage instance is dynamic and
equivalent to directly loading the original model1.ecore file?

There is an EEnum in this EPackage and I discovered that after copying
the package the enum literals return genrated instances from
literal.getInstance(). Is that a bug or a feature?

Cheers
/Eike

----
http://thegordian.blogspot.com
http://twitter.com/eikestepper



--------------060506030504000206060800
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi,<br>
<br>
I copied a generated model:<br>
<br>
<title></title>
<style type="text/css">
<!--code { font-family: Courier New, Courier; font-size: 10pt; margin: 0px; }-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- ======================================================== -->
<!-- = Java Sourcecode to HTML automatically converted code = --><!-- = Java2Html Converter 5.0 [2006-02-26] by Markus Gebhard markus@jave.de = -->
<!-- = Further information: http://www.java2html.de = -->
<div class="java" align="left">
<table bgcolor="#ffffff" border="0" cellpadding="3" cellspacing="0">
<tbody>
<tr>
<!-- start source code --> <td align="left" nowrap="nowrap"
valign="top"> <code><font color="#ffffff">
Re: Copy of generated model [message #431500 is a reply to message #431499] Tue, 14 July 2009 06:42 Go to previous messageGo to next message
Eclipse UserFriend
Eike,

Did you change the nsURI of the copied EPackage? If not, you are likely to
run into trouble since anyone resolving the EPackage or the Factory by nsURI
will retrieve the originally registered instance. Maybe this is what happens
with your enum literals.

Cheers,
Achim

Eike Stepper wrote:

> Hi,
>
> I copied a generated model:
>
> | EPackage model1 = (EPackage)EcoreUtil.copy(getModel1Package());|
>
>
> Can I expect that the resulting EPackage instance is dynamic and
> equivalent to directly loading the original model1.ecore file?
>
> There is an EEnum in this EPackage and I discovered that after copying
> the package the enum literals return genrated instances from
> literal.getInstance(). Is that a bug or a feature?
>
> Cheers
> /Eike
>
> ----
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
Re: Copy of generated model [message #431501 is a reply to message #431500] Tue, 14 July 2009 06:45 Go to previous messageGo to next message
Eclipse UserFriend
Achim Demelt schrieb:
> Eike,
>
> Did you change the nsURI of the copied EPackage? If not, you are likely to
> run into trouble since anyone resolving the EPackage or the Factory by nsURI
> will retrieve the originally registered instance. Maybe this is what happens
> with your enum literals.
>
Well, I'm using my own registry but I'll try your hint. Thx ;-)

Cheers
/Eike

----
http://thegordian.blogspot.com
http://twitter.com/eikestepper


> Cheers,
> Achim
>
> Eike Stepper wrote:
>
>
>> Hi,
>>
>> I copied a generated model:
>>
>> | EPackage model1 = (EPackage)EcoreUtil.copy(getModel1Package());|
>>
>>
>> Can I expect that the resulting EPackage instance is dynamic and
>> equivalent to directly loading the original model1.ecore file?
>>
>> There is an EEnum in this EPackage and I discovered that after copying
>> the package the enum literals return genrated instances from
>> literal.getInstance(). Is that a bug or a feature?
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>
>
>
Re: Copy of generated model [message #431508 is a reply to message #431499] Tue, 14 July 2009 10:23 Go to previous message
Eclipse UserFriend
A bug, according to Ed:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=283419

Cheers
/Eike

----
http://thegordian.blogspot.com
http://twitter.com/eikestepper



Eike Stepper schrieb:
> Hi,
>
> I copied a generated model:
>
> | EPackage model1 = (EPackage)EcoreUtil.copy(getModel1Package());|
>
>
> Can I expect that the resulting EPackage instance is dynamic and
> equivalent to directly loading the original model1.ecore file?
>
> There is an EEnum in this EPackage and I discovered that after copying
> the package the enum literals return genrated instances from
> literal.getInstance(). Is that a bug or a feature?
>
> Cheers
> /Eike
>
> ----
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
Previous Topic:passing a hibernate.cfg.xml to teneo
Next Topic:isComposite and isId usage ?
Goto Forum:
  


Current Time: Wed Jul 23 22:03:30 EDT 2025

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

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

Back to the top