Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external')
-rw-r--r--tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/ExternalObject.java1
-rwxr-xr-xtests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/ExternalTest.java3
-rwxr-xr-xtests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/impl/ExternalPackageImpl.java44
-rwxr-xr-xtests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/model/external.ecore19
-rwxr-xr-xtests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/model/external.genmodel9
-rwxr-xr-xtests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/util/ExternalAdapterFactory.java1
-rwxr-xr-xtests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/util/ExternalSwitch.java37
7 files changed, 76 insertions, 38 deletions
diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/ExternalObject.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/ExternalObject.java
index 3d67ce662..96b1425f9 100644
--- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/ExternalObject.java
+++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/ExternalObject.java
@@ -16,6 +16,7 @@ import org.eclipse.emf.ecore.EObject;
*
* @see org.eclipse.emf.teneo.samples.emf.annotations.external.ExternalPackage#getExternalObject()
* @model annotation="teneo.jpa value='@External'"
+ * annotation="teneo.jpa.auditing value='@External'"
* @generated
*/
public interface ExternalObject extends EObject {
diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/ExternalTest.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/ExternalTest.java
index 890bc3a68..f9cc146c7 100755
--- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/ExternalTest.java
+++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/ExternalTest.java
@@ -72,6 +72,7 @@ public interface ExternalTest extends EObject {
* @see #setEObject(EObject)
* @see org.eclipse.emf.teneo.samples.emf.annotations.external.ExternalPackage#getExternalTest_EObject()
* @model annotation="teneo.jpa value='@External'"
+ * annotation="teneo.jpa.auditing value='@External'"
* @generated
*/
EObject getEObject();
@@ -98,6 +99,7 @@ public interface ExternalTest extends EObject {
* @return the value of the '<em>EObjects</em>' reference list.
* @see org.eclipse.emf.teneo.samples.emf.annotations.external.ExternalPackage#getExternalTest_EObjects()
* @model annotation="teneo.jpa value='@External'"
+ * annotation="teneo.jpa.auditing value='@External'"
* @generated
*/
EList<EObject> getEObjects();
@@ -114,6 +116,7 @@ public interface ExternalTest extends EObject {
* @see #setEClass(EClass)
* @see org.eclipse.emf.teneo.samples.emf.annotations.external.ExternalPackage#getExternalTest_EClass()
* @model annotation="teneo.jpa value='@External(type=\"org.eclipse.emf.teneo.hibernate.mapping.EcoreModelElementType\")'"
+ * annotation="teneo.jpa.auditing value='@External(type=\"org.eclipse.emf.teneo.hibernate.mapping.EcoreModelElementType\")'"
* @generated
*/
EClass getEClass();
diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/impl/ExternalPackageImpl.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/impl/ExternalPackageImpl.java
index 9bcf528f9..af9586222 100755
--- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/impl/ExternalPackageImpl.java
+++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/impl/ExternalPackageImpl.java
@@ -267,6 +267,8 @@ public class ExternalPackageImpl extends EPackageImpl implements ExternalPackage
createExtendedMetaDataAnnotations();
// teneo.jpa
createTeneoAnnotations();
+ // teneo.jpa.auditing
+ createTeneo_1Annotations();
}
/**
@@ -283,7 +285,7 @@ public class ExternalPackageImpl extends EPackageImpl implements ExternalPackage
new String[] {
"kind", "element",
"name", "city"
- });
+ });
}
/**
@@ -299,19 +301,53 @@ public class ExternalPackageImpl extends EPackageImpl implements ExternalPackage
source,
new String[] {
"value", "@External"
- });
+ });
addAnnotation
(getExternalTest_EObjects(),
source,
new String[] {
"value", "@External"
- });
+ });
addAnnotation
(getExternalTest_EClass(),
source,
new String[] {
"value", "@External(type=\"org.eclipse.emf.teneo.hibernate.mapping.EcoreModelElementType\")"
- });
+ });
+ addAnnotation
+ (externalObjectEClass,
+ source,
+ new String[] {
+ "value", "@External"
+ });
+ }
+
+ /**
+ * Initializes the annotations for <b>teneo.jpa.auditing</b>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void createTeneo_1Annotations() {
+ String source = "teneo.jpa.auditing";
+ addAnnotation
+ (getExternalTest_EObject(),
+ source,
+ new String[] {
+ "value", "@External"
+ });
+ addAnnotation
+ (getExternalTest_EObjects(),
+ source,
+ new String[] {
+ "value", "@External"
+ });
+ addAnnotation
+ (getExternalTest_EClass(),
+ source,
+ new String[] {
+ "value", "@External(type=\"org.eclipse.emf.teneo.hibernate.mapping.EcoreModelElementType\")"
+ });
addAnnotation
(externalObjectEClass,
source,
diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/model/external.ecore b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/model/external.ecore
index b13fcb239..f1fe4a2e6 100755
--- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/model/external.ecore
+++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/model/external.ecore
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<ecore:EPackage xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="external"
- nsURI="http://www.eclipse.org/emf/teneo/samples/emf/annotations/external" nsPrefix="external">
+<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="external" nsURI="http://www.eclipse.org/emf/teneo/samples/emf/annotations/external"
+ nsPrefix="external">
<eClassifiers xsi:type="ecore:EClass" name="ExternalTest">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" unique="false" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
@@ -15,17 +14,26 @@
<eAnnotations source="teneo.jpa">
<details key="value" value="@External"/>
</eAnnotations>
+ <eAnnotations source="teneo.jpa.auditing">
+ <details key="value" value="@External"/>
+ </eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="eObjects" upperBound="-1"
eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EObject">
<eAnnotations source="teneo.jpa">
<details key="value" value="@External"/>
</eAnnotations>
+ <eAnnotations source="teneo.jpa.auditing">
+ <details key="value" value="@External"/>
+ </eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="eClass" eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EClass">
<eAnnotations source="teneo.jpa">
<details key="value" value="@External(type=&quot;org.eclipse.emf.teneo.hibernate.mapping.EcoreModelElementType&quot;)"/>
</eAnnotations>
+ <eAnnotations source="teneo.jpa.auditing">
+ <details key="value" value="@External(type=&quot;org.eclipse.emf.teneo.hibernate.mapping.EcoreModelElementType&quot;)"/>
+ </eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="externalObject" eType="#//ExternalObject"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="externalObjects" upperBound="-1"
@@ -35,5 +43,8 @@
<eAnnotations source="teneo.jpa">
<details key="value" value="@External"/>
</eAnnotations>
+ <eAnnotations source="teneo.jpa.auditing">
+ <details key="value" value="@External"/>
+ </eAnnotations>
</eClassifiers>
</ecore:EPackage>
diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/model/external.genmodel b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/model/external.genmodel
index 877df23f1..7fa8786d5 100755
--- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/model/external.genmodel
+++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/model/external.genmodel
@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
-<genmodel:GenModel xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.eclipse.emf.teneo.samples/src"
- modelPluginID="org.eclipse.emf.teneo.samples" modelName="External" importerID="org.eclipse.emf.importer.ecore"
- complianceLevel="5.0" copyrightFields="false">
+<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
+ xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.eclipse.emf.teneo.samples/src" modelPluginID="org.eclipse.emf.teneo.samples"
+ modelName="External" importerID="org.eclipse.emf.importer.ecore" complianceLevel="5.0"
+ copyrightFields="false">
<foreignModel>external.ecore</foreignModel>
<genPackages prefix="External" basePackage="org.eclipse.emf.teneo.samples.emf.annotations"
resource="XML" disposableProviderFactory="true" ecorePackage="external.ecore#/">
diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/util/ExternalAdapterFactory.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/util/ExternalAdapterFactory.java
index c874e202a..32db33607 100755
--- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/util/ExternalAdapterFactory.java
+++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/util/ExternalAdapterFactory.java
@@ -10,6 +10,7 @@ import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.teneo.samples.emf.annotations.external.*;
import org.eclipse.emf.teneo.samples.emf.annotations.external.ExternalObject;
import org.eclipse.emf.teneo.samples.emf.annotations.external.ExternalPackage;
import org.eclipse.emf.teneo.samples.emf.annotations.external.ExternalTest;
diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/util/ExternalSwitch.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/util/ExternalSwitch.java
index 204149014..54008357c 100755
--- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/util/ExternalSwitch.java
+++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/util/ExternalSwitch.java
@@ -10,6 +10,9 @@ import java.util.List;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.util.Switch;
+import org.eclipse.emf.teneo.samples.emf.annotations.external.*;
import org.eclipse.emf.teneo.samples.emf.annotations.external.ExternalObject;
import org.eclipse.emf.teneo.samples.emf.annotations.external.ExternalPackage;
import org.eclipse.emf.teneo.samples.emf.annotations.external.ExternalTest;
@@ -27,7 +30,7 @@ import org.eclipse.emf.teneo.samples.emf.annotations.external.ExternalTest;
* @see org.eclipse.emf.teneo.samples.emf.annotations.external.ExternalPackage
* @generated
*/
-public class ExternalSwitch<T> {
+public class ExternalSwitch<T> extends Switch<T> {
/**
* The cached model package
* <!-- begin-user-doc -->
@@ -49,34 +52,16 @@ public class ExternalSwitch<T> {
}
/**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * Checks whether this is a switch for the given package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @parameter ePackage the package in question.
+ * @return whether this is a switch for the given package.
* @generated
*/
- public T doSwitch(EObject theEObject) {
- return doSwitch(theEObject.eClass(), theEObject);
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
- */
- protected T doSwitch(EClass theEClass, EObject theEObject) {
- if (theEClass.eContainer() == modelPackage) {
- return doSwitch(theEClass.getClassifierID(), theEObject);
- }
- else {
- List<EClass> eSuperTypes = theEClass.getESuperTypes();
- return
- eSuperTypes.isEmpty() ?
- defaultCase(theEObject) :
- doSwitch(eSuperTypes.get(0), theEObject);
- }
+ @Override
+ protected boolean isSwitchFor(EPackage ePackage) {
+ return ePackage == modelPackage;
}
/**
@@ -86,6 +71,7 @@ public class ExternalSwitch<T> {
* @return the first non-null result returned by a <code>caseXXX</code> call.
* @generated
*/
+ @Override
protected T doSwitch(int classifierID, EObject theEObject) {
switch (classifierID) {
case ExternalPackage.EXTERNAL_TEST: {
@@ -145,6 +131,7 @@ public class ExternalSwitch<T> {
* @see #doSwitch(org.eclipse.emf.ecore.EObject)
* @generated
*/
+ @Override
public T defaultCase(EObject object) {
return null;
}

Back to the top