-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7393902
commit 1a917f6
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
edelta.parent/edelta.example/edelta-gen/edelta/ExampleAcrossEPackages2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package edelta; | ||
|
||
import edelta.lib.AbstractEdelta; | ||
import org.eclipse.emf.ecore.EPackage; | ||
import org.eclipse.emf.ecore.EReference; | ||
|
||
@SuppressWarnings("all") | ||
public class ExampleAcrossEPackages2 extends AbstractEdelta { | ||
public ExampleAcrossEPackages2() { | ||
|
||
} | ||
|
||
public ExampleAcrossEPackages2(final AbstractEdelta other) { | ||
super(other); | ||
} | ||
|
||
public void aTest1(final EPackage it) { | ||
EReference _eOpposite = getEReference("testecoreforreferences1", "Person", "works").getEOpposite(); | ||
_eOpposite.setName("renamedPersons"); | ||
EReference _eOpposite_1 = getEReference("testecoreforreferences2", "WorkPlace", "renamedPersons").getEOpposite(); | ||
_eOpposite_1.setName("renamedWorks"); | ||
} | ||
|
||
@Override | ||
public void performSanityChecks() throws Exception { | ||
ensureEPackageIsLoaded("testecoreforreferences1"); | ||
ensureEPackageIsLoaded("testecoreforreferences2"); | ||
} | ||
|
||
@Override | ||
protected void doExecute() throws Exception { | ||
aTest1(getEPackage("testecoreforreferences1")); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
edelta.parent/edelta.example/src/ExampleAcrossEPackages2.edelta
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
metamodel "testecoreforreferences1" | ||
metamodel "testecoreforreferences2" | ||
|
||
modifyEcore aTest1 epackage testecoreforreferences1 { | ||
// renames WorkPlace.persons to renamedPersons | ||
ecoreref(works).EOpposite.name = "renamedPersons" | ||
// renames Person.works to renamedWorks | ||
// using the already renamed feature (was persons) | ||
ecoreref(renamedPersons).EOpposite.name = "renamedWorks" | ||
} |