diff options
Diffstat (limited to 'tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf')
41 files changed, 373 insertions, 293 deletions
diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attributeoverrides/Person.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attributeoverrides/Person.java index a24349377..d49025ed9 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attributeoverrides/Person.java +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attributeoverrides/Person.java @@ -70,6 +70,7 @@ public interface Person extends EObject { * @see org.eclipse.emf.teneo.samples.emf.annotations.attributeoverrides.AttributeoverridesPackage#getPerson_BornIn() * @model required="true" * annotation="teneo.jpa appinfo='@Embedded\n@AttributeOverride(name=\"name\" column=@Column(name=\"bornNameColumn\"))'" + * annotation="teneo.jpa.auditing appinfo='@Embedded\n@AttributeOverride(name=\"name\" column=@Column(name=\"bornNameColumn\"))'" * @generated */ City getBornIn(); @@ -97,6 +98,7 @@ public interface Person extends EObject { * @see org.eclipse.emf.teneo.samples.emf.annotations.attributeoverrides.AttributeoverridesPackage#getPerson_LivesIn() * @model required="true" * annotation="teneo.jpa appinfo='@Embedded\n@AttributeOverrides({\n\t@AttributeOverride(name=\"name\" column=@Column(name=\"nameColumn\")),\n\t@AttributeOverride(name=\"country\" column=@Column(name=\"countryColumn\"))\n})'" + * annotation="teneo.jpa.auditing appinfo='@Embedded\n@AttributeOverrides({\n\t@AttributeOverride(name=\"name\" column=@Column(name=\"nameColumn\")),\n\t@AttributeOverride(name=\"country\" column=@Column(name=\"countryColumn\"))\n})'" * @generated */ City getLivesIn(); diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attributeoverrides/impl/AttributeoverridesPackageImpl.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attributeoverrides/impl/AttributeoverridesPackageImpl.java index 590662532..a3a8514ea 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attributeoverrides/impl/AttributeoverridesPackageImpl.java +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attributeoverrides/impl/AttributeoverridesPackageImpl.java @@ -64,20 +64,10 @@ public class AttributeoverridesPackageImpl extends EPackageImpl implements Attri private static boolean isInited = false; /** - * Creates, registers, and initializes the <b>Package</b> for this - * model, and for any others upon which it depends. Simple - * dependencies are satisfied by calling this method on all - * dependent packages before doing anything else. This method drives - * initialization for interdependent packages directly, in parallel - * with this package, itself. - * <p>Of this package and its interdependencies, all packages which - * have not yet been registered by their URI values are first created - * and registered. The packages are then initialized in two steps: - * meta-model objects for all of the packages are created before any - * are initialized, since one package's meta-model objects may refer to - * those of another. - * <p>Invocation of this method will not affect any packages that have - * already been initialized. + * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. + * + * <p>This method is used to initialize {@link AttributeoverridesPackage#eINSTANCE} when that field is accessed. + * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #eNS_URI @@ -89,7 +79,7 @@ public class AttributeoverridesPackageImpl extends EPackageImpl implements Attri if (isInited) return (AttributeoverridesPackage)EPackage.Registry.INSTANCE.getEPackage(AttributeoverridesPackage.eNS_URI); // Obtain or create and register package - AttributeoverridesPackageImpl theAttributeoverridesPackage = (AttributeoverridesPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof AttributeoverridesPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new AttributeoverridesPackageImpl()); + AttributeoverridesPackageImpl theAttributeoverridesPackage = (AttributeoverridesPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof AttributeoverridesPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new AttributeoverridesPackageImpl()); isInited = true; @@ -102,6 +92,9 @@ public class AttributeoverridesPackageImpl extends EPackageImpl implements Attri // Mark meta-data to indicate it can't be changed theAttributeoverridesPackage.freeze(); + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(AttributeoverridesPackage.eNS_URI, theAttributeoverridesPackage); return theAttributeoverridesPackage; } @@ -251,6 +244,8 @@ public class AttributeoverridesPackageImpl extends EPackageImpl implements Attri // Create annotations // teneo.jpa createTeneoAnnotations(); + // teneo.jpa.auditing + createTeneo_1Annotations(); } /** @@ -266,13 +261,13 @@ public class AttributeoverridesPackageImpl extends EPackageImpl implements Attri source, new String[] { "appinfo", "@Embedded\n@AttributeOverride(name=\"name\" column=@Column(name=\"bornNameColumn\"))" - }); + }); addAnnotation (getPerson_LivesIn(), source, new String[] { "appinfo", "@Embedded\n@AttributeOverrides({\n\t@AttributeOverride(name=\"name\" column=@Column(name=\"nameColumn\")),\n\t@AttributeOverride(name=\"country\" column=@Column(name=\"countryColumn\"))\n})" - }); + }); addAnnotation (cityEClass, source, @@ -281,4 +276,26 @@ public class AttributeoverridesPackageImpl extends EPackageImpl implements Attri }); } + /** + * 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 + (getPerson_BornIn(), + source, + new String[] { + "appinfo", "@Embedded\n@AttributeOverride(name=\"name\" column=@Column(name=\"bornNameColumn\"))" + }); + addAnnotation + (getPerson_LivesIn(), + source, + new String[] { + "appinfo", "@Embedded\n@AttributeOverrides({\n\t@AttributeOverride(name=\"name\" column=@Column(name=\"nameColumn\")),\n\t@AttributeOverride(name=\"country\" column=@Column(name=\"countryColumn\"))\n})" + }); + } + } //AttributeoverridesPackageImpl diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attributeoverrides/impl/PersonImpl.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attributeoverrides/impl/PersonImpl.java index 5af20554c..d264de1f5 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attributeoverrides/impl/PersonImpl.java +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attributeoverrides/impl/PersonImpl.java @@ -59,7 +59,7 @@ public class PersonImpl extends EObjectImpl implements Person { * @generated * @ordered */ - protected City bornIn = null; + protected City bornIn; /** * The cached value of the '{@link #getLivesIn() <em>Lives In</em>}' reference. @@ -69,7 +69,7 @@ public class PersonImpl extends EObjectImpl implements Person { * @generated * @ordered */ - protected City livesIn = null; + protected City livesIn; /** * <!-- begin-user-doc --> diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attributeoverrides/model/AttributeOverrides.ecore b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attributeoverrides/model/AttributeOverrides.ecore index ff1b62dee..ef0a0c112 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attributeoverrides/model/AttributeOverrides.ecore +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attributeoverrides/model/AttributeOverrides.ecore @@ -1,8 +1,6 @@ <?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="attributeoverrides" - nsURI="http:///org/eclipse/emf/teneo/samples/emf/annotations/attributeoverrides.ecore" +<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="attributeoverrides" nsURI="http:///org/eclipse/emf/teneo/samples/emf/annotations/attributeoverrides.ecore" nsPrefix="org.eclipse.emf.teneo.samples.emf.annotations.attributeoverrides"> <eClassifiers xsi:type="ecore:EClass" name="Person"> <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> @@ -14,12 +12,18 @@ <eAnnotations source="teneo.jpa"> <details key="appinfo" value="@Embedded
@AttributeOverride(name="name" column=@Column(name="bornNameColumn"))"/> </eAnnotations> + <eAnnotations source="teneo.jpa.auditing"> + <details key="appinfo" value="@Embedded
@AttributeOverride(name="name" column=@Column(name="bornNameColumn"))"/> + </eAnnotations> </eStructuralFeatures> <eStructuralFeatures xsi:type="ecore:EReference" name="livesIn" lowerBound="1" eType="#//City"> <eAnnotations source="teneo.jpa"> <details key="appinfo" value="@Embedded
@AttributeOverrides({
	@AttributeOverride(name="name" column=@Column(name="nameColumn")),
	@AttributeOverride(name="country" column=@Column(name="countryColumn"))
})"/> </eAnnotations> + <eAnnotations source="teneo.jpa.auditing"> + <details key="appinfo" value="@Embedded
@AttributeOverrides({
	@AttributeOverride(name="name" column=@Column(name="nameColumn")),
	@AttributeOverride(name="country" column=@Column(name="countryColumn"))
})"/> + </eAnnotations> </eStructuralFeatures> </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="City"> diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attributeoverrides/model/AttributesOverrides.genmodel b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attributeoverrides/model/AttributesOverrides.genmodel index 795e0507a..aa04861a8 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attributeoverrides/model/AttributesOverrides.genmodel +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attributeoverrides/model/AttributesOverrides.genmodel @@ -1,9 +1,7 @@ <?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="AttributesOverrides" - importerID="org.eclipse.emf.importer.ecore" complianceLevel="5.0"> +<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="AttributesOverrides" importerID="org.eclipse.emf.importer.ecore" complianceLevel="5.0"> <foreignModel>AttributeOverrides.ecore</foreignModel> <genPackages prefix="Attributeoverrides" basePackage="org.eclipse.emf.teneo.samples.emf.annotations" disposableProviderFactory="true" ecorePackage="AttributeOverrides.ecore#/"> diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attributeoverrides/util/AttributeoverridesAdapterFactory.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attributeoverrides/util/AttributeoverridesAdapterFactory.java index 244fdbd35..5d0b134a0 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attributeoverrides/util/AttributeoverridesAdapterFactory.java +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attributeoverrides/util/AttributeoverridesAdapterFactory.java @@ -65,7 +65,7 @@ public class AttributeoverridesAdapterFactory extends AdapterFactoryImpl { } /** - * The switch the delegates to the <code>createXXX</code> methods. + * The switch that delegates to the <code>createXXX</code> methods. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attributeoverrides/util/AttributeoverridesSwitch.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attributeoverrides/util/AttributeoverridesSwitch.java index 9fd5402c9..73741f508 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attributeoverrides/util/AttributeoverridesSwitch.java +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attributeoverrides/util/AttributeoverridesSwitch.java @@ -10,6 +10,8 @@ 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.attributeoverrides.*; import org.eclipse.emf.teneo.samples.emf.annotations.attributeoverrides.AttributeoverridesPackage; @@ -29,7 +31,7 @@ import org.eclipse.emf.teneo.samples.emf.annotations.attributeoverrides.Person; * @see org.eclipse.emf.teneo.samples.emf.annotations.attributeoverrides.AttributeoverridesPackage * @generated */ -public class AttributeoverridesSwitch<T> { +public class AttributeoverridesSwitch<T> extends Switch<T> { /** * The cached model package * <!-- begin-user-doc --> @@ -51,34 +53,16 @@ public class AttributeoverridesSwitch<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; } /** @@ -88,6 +72,7 @@ public class AttributeoverridesSwitch<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 AttributeoverridesPackage.PERSON: { @@ -107,13 +92,13 @@ public class AttributeoverridesSwitch<T> { } /** - * Returns the result of interpretting the object as an instance of '<em>Person</em>'. + * Returns the result of interpreting the object as an instance of '<em>Person</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>Person</em>'. + * @return the result of interpreting the object as an instance of '<em>Person</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ @@ -122,13 +107,13 @@ public class AttributeoverridesSwitch<T> { } /** - * Returns the result of interpretting the object as an instance of '<em>City</em>'. + * Returns the result of interpreting the object as an instance of '<em>City</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>City</em>'. + * @return the result of interpreting the object as an instance of '<em>City</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ @@ -137,16 +122,17 @@ public class AttributeoverridesSwitch<T> { } /** - * Returns the result of interpretting the object as an instance of '<em>EObject</em>'. + * Returns the result of interpreting the object as an instance of '<em>EObject</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch, but this is the last case anyway. * <!-- end-user-doc --> * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>EObject</em>'. + * @return the result of interpreting the object as an instance of '<em>EObject</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) * @generated */ + @Override public T defaultCase(EObject object) { return null; } diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attroverridesecondarytable/Address.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attroverridesecondarytable/Address.java index 3d68cabdc..43fdb0386 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attroverridesecondarytable/Address.java +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attroverridesecondarytable/Address.java @@ -25,6 +25,7 @@ import org.eclipse.emf.ecore.EObject; * * @see org.eclipse.emf.teneo.samples.emf.annotations.attroverridesecondarytable.AttroverridesecondarytablePackage#getAddress() * @model annotation="teneo.jpa value='@Embeddable'" + * annotation="teneo.jpa.auditing value='@Embeddable'" * @generated */ public interface Address extends EObject { diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attroverridesecondarytable/Employee.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attroverridesecondarytable/Employee.java index 138d063f2..149da40dd 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attroverridesecondarytable/Employee.java +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attroverridesecondarytable/Employee.java @@ -37,6 +37,7 @@ public interface Employee extends Person { * @see #setAddress(Address) * @see org.eclipse.emf.teneo.samples.emf.annotations.attroverridesecondarytable.AttroverridesecondarytablePackage#getEmployee_Address() * @model annotation="teneo.jpa value='@Embedded\n@AttributeOverrides({\n\t@AttributeOverride(name=\"name\" column=@Column(name=\"other_name\" table=\"secondary_table\")),\n\t@AttributeOverride(name=\"street\" column=@Column(name=\"other_street\" table=\"secondary_table\")),\n\t@AttributeOverride(name=\"city\" column=@Column(name=\"other_city\" table=\"secondary_table\"))\n})\n@AssociationOverrides({\n\t@AssociationOverride(name=\"country\" joinColumns=@JoinColumn(name=\"addr_country\" table=\"secondary_table\"))\n})'" + * annotation="teneo.jpa.auditing value='@Embedded\n@AttributeOverrides({\n\t@AttributeOverride(name=\"name\" column=@Column(name=\"other_name\" table=\"secondary_table\")),\n\t@AttributeOverride(name=\"street\" column=@Column(name=\"other_street\" table=\"secondary_table\")),\n\t@AttributeOverride(name=\"city\" column=@Column(name=\"other_city\" table=\"secondary_table\"))\n})\n@AssociationOverrides({\n\t@AssociationOverride(name=\"country\" joinColumns=@JoinColumn(name=\"addr_country\" table=\"secondary_table\"))\n})'" * @generated */ Address getAddress(); diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attroverridesecondarytable/NonEmployee.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attroverridesecondarytable/NonEmployee.java index 7959a4c0c..5a0062db7 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attroverridesecondarytable/NonEmployee.java +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attroverridesecondarytable/NonEmployee.java @@ -36,6 +36,7 @@ public interface NonEmployee extends Person { * @see #setAddress(Address) * @see org.eclipse.emf.teneo.samples.emf.annotations.attroverridesecondarytable.AttroverridesecondarytablePackage#getNonEmployee_Address() * @model annotation="teneo.jpa value='@Embedded'" + * annotation="teneo.jpa.auditing value='@Embedded'" * @generated */ Address getAddress(); diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attroverridesecondarytable/impl/AttroverridesecondarytablePackageImpl.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attroverridesecondarytable/impl/AttroverridesecondarytablePackageImpl.java index 9026743a1..4f04f4e11 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attroverridesecondarytable/impl/AttroverridesecondarytablePackageImpl.java +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attroverridesecondarytable/impl/AttroverridesecondarytablePackageImpl.java @@ -90,20 +90,10 @@ public class AttroverridesecondarytablePackageImpl extends EPackageImpl implemen private static boolean isInited = false; /** - * Creates, registers, and initializes the <b>Package</b> for this - * model, and for any others upon which it depends. Simple - * dependencies are satisfied by calling this method on all - * dependent packages before doing anything else. This method drives - * initialization for interdependent packages directly, in parallel - * with this package, itself. - * <p>Of this package and its interdependencies, all packages which - * have not yet been registered by their URI values are first created - * and registered. The packages are then initialized in two steps: - * meta-model objects for all of the packages are created before any - * are initialized, since one package's meta-model objects may refer to - * those of another. - * <p>Invocation of this method will not affect any packages that have - * already been initialized. + * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. + * + * <p>This method is used to initialize {@link AttroverridesecondarytablePackage#eINSTANCE} when that field is accessed. + * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #eNS_URI @@ -115,7 +105,7 @@ public class AttroverridesecondarytablePackageImpl extends EPackageImpl implemen if (isInited) return (AttroverridesecondarytablePackage)EPackage.Registry.INSTANCE.getEPackage(AttroverridesecondarytablePackage.eNS_URI); // Obtain or create and register package - AttroverridesecondarytablePackageImpl theAttroverridesecondarytablePackage = (AttroverridesecondarytablePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof AttroverridesecondarytablePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new AttroverridesecondarytablePackageImpl()); + AttroverridesecondarytablePackageImpl theAttroverridesecondarytablePackage = (AttroverridesecondarytablePackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof AttroverridesecondarytablePackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new AttroverridesecondarytablePackageImpl()); isInited = true; @@ -128,6 +118,9 @@ public class AttroverridesecondarytablePackageImpl extends EPackageImpl implemen // Mark meta-data to indicate it can't be changed theAttroverridesecondarytablePackage.freeze(); + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(AttroverridesecondarytablePackage.eNS_URI, theAttroverridesecondarytablePackage); return theAttroverridesecondarytablePackage; } @@ -373,6 +366,8 @@ public class AttroverridesecondarytablePackageImpl extends EPackageImpl implemen // Create annotations // teneo.jpa createTeneoAnnotations(); + // teneo.jpa.auditing + createTeneo_1Annotations(); } /** @@ -388,7 +383,7 @@ public class AttroverridesecondarytablePackageImpl extends EPackageImpl implemen source, new String[] { "value", "@Embeddable" - }); + }); addAnnotation (personEClass, source, @@ -406,7 +401,7 @@ public class AttroverridesecondarytablePackageImpl extends EPackageImpl implemen source, new String[] { "value", "@Embedded\n@AttributeOverrides({\n\t@AttributeOverride(name=\"name\" column=@Column(name=\"other_name\" table=\"secondary_table\")),\n\t@AttributeOverride(name=\"street\" column=@Column(name=\"other_street\" table=\"secondary_table\")),\n\t@AttributeOverride(name=\"city\" column=@Column(name=\"other_city\" table=\"secondary_table\"))\n})\n@AssociationOverrides({\n\t@AssociationOverride(name=\"country\" joinColumns=@JoinColumn(name=\"addr_country\" table=\"secondary_table\"))\n})" - }); + }); addAnnotation (getEmployee_EmployeeNumber(), source, @@ -418,6 +413,34 @@ public class AttroverridesecondarytablePackageImpl extends EPackageImpl implemen source, new String[] { "value", "@Embedded" + }); + } + + /** + * 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 + (addressEClass, + source, + new String[] { + "value", "@Embeddable" + }); + addAnnotation + (getEmployee_Address(), + source, + new String[] { + "value", "@Embedded\n@AttributeOverrides({\n\t@AttributeOverride(name=\"name\" column=@Column(name=\"other_name\" table=\"secondary_table\")),\n\t@AttributeOverride(name=\"street\" column=@Column(name=\"other_street\" table=\"secondary_table\")),\n\t@AttributeOverride(name=\"city\" column=@Column(name=\"other_city\" table=\"secondary_table\"))\n})\n@AssociationOverrides({\n\t@AssociationOverride(name=\"country\" joinColumns=@JoinColumn(name=\"addr_country\" table=\"secondary_table\"))\n})" + }); + addAnnotation + (getNonEmployee_Address(), + source, + new String[] { + "value", "@Embedded" }); } diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attroverridesecondarytable/impl/PersonImpl.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attroverridesecondarytable/impl/PersonImpl.java index 0daff4cd9..2f796d650 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attroverridesecondarytable/impl/PersonImpl.java +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attroverridesecondarytable/impl/PersonImpl.java @@ -143,7 +143,7 @@ public class PersonImpl extends EObjectImpl implements Person { case AttroverridesecondarytablePackage.PERSON__NAME: return getName(); case AttroverridesecondarytablePackage.PERSON__AGE: - return new Integer(getAge()); + return getAge(); } return super.eGet(featureID, resolve, coreType); } @@ -160,7 +160,7 @@ public class PersonImpl extends EObjectImpl implements Person { setName((String)newValue); return; case AttroverridesecondarytablePackage.PERSON__AGE: - setAge(((Integer)newValue).intValue()); + setAge((Integer)newValue); return; } super.eSet(featureID, newValue); diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attroverridesecondarytable/model/overridesecondarytable.ecore b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attroverridesecondarytable/model/overridesecondarytable.ecore index 674daedb0..0baeb5db6 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attroverridesecondarytable/model/overridesecondarytable.ecore +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attroverridesecondarytable/model/overridesecondarytable.ecore @@ -1,13 +1,14 @@ <?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="attroverridesecondarytable" - nsURI="http://www.eclipse.org/emf/teneo/samples/emf/annotations/attroverridesecondarytable" +<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="attroverridesecondarytable" nsURI="http://www.eclipse.org/emf/teneo/samples/emf/annotations/attroverridesecondarytable" nsPrefix="attroverridesecondarytable"> <eClassifiers xsi:type="ecore:EClass" name="Address"> <eAnnotations source="teneo.jpa"> <details key="value" value="@Embeddable"/> </eAnnotations> + <eAnnotations source="teneo.jpa.auditing"> + <details key="value" value="@Embeddable"/> + </eAnnotations> <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> <eStructuralFeatures xsi:type="ecore:EAttribute" name="street" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> <eStructuralFeatures xsi:type="ecore:EAttribute" name="city" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> @@ -28,6 +29,9 @@ <eAnnotations source="teneo.jpa"> <details key="value" value="@Embedded
@AttributeOverrides({
	@AttributeOverride(name="name" column=@Column(name="other_name" table="secondary_table")),
	@AttributeOverride(name="street" column=@Column(name="other_street" table="secondary_table")),
	@AttributeOverride(name="city" column=@Column(name="other_city" table="secondary_table"))
})
@AssociationOverrides({
	@AssociationOverride(name="country" joinColumns=@JoinColumn(name="addr_country" table="secondary_table"))
})"/> </eAnnotations> + <eAnnotations source="teneo.jpa.auditing"> + <details key="value" value="@Embedded
@AttributeOverrides({
	@AttributeOverride(name="name" column=@Column(name="other_name" table="secondary_table")),
	@AttributeOverride(name="street" column=@Column(name="other_street" table="secondary_table")),
	@AttributeOverride(name="city" column=@Column(name="other_city" table="secondary_table"))
})
@AssociationOverrides({
	@AssociationOverride(name="country" joinColumns=@JoinColumn(name="addr_country" table="secondary_table"))
})"/> + </eAnnotations> </eStructuralFeatures> <eStructuralFeatures xsi:type="ecore:EAttribute" name="employeeNumber" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"> <eAnnotations source="teneo.jpa"> @@ -40,6 +44,9 @@ <eAnnotations source="teneo.jpa"> <details key="value" value="@Embedded"/> </eAnnotations> + <eAnnotations source="teneo.jpa.auditing"> + <details key="value" value="@Embedded"/> + </eAnnotations> </eStructuralFeatures> </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="Country"> diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attroverridesecondarytable/model/overridesecondarytable.genmodel b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attroverridesecondarytable/model/overridesecondarytable.genmodel index 621c03ea8..c745929bd 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attroverridesecondarytable/model/overridesecondarytable.genmodel +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attroverridesecondarytable/model/overridesecondarytable.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="Overridesecondarytable" - 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="Overridesecondarytable" importerID="org.eclipse.emf.importer.ecore" + complianceLevel="5.0" copyrightFields="false"> <foreignModel>overridesecondarytable.ecore</foreignModel> <genPackages prefix="Attroverridesecondarytable" basePackage="org.eclipse.emf.teneo.samples.emf.annotations" disposableProviderFactory="true" ecorePackage="overridesecondarytable.ecore#/"> diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attroverridesecondarytable/util/AttroverridesecondarytableSwitch.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attroverridesecondarytable/util/AttroverridesecondarytableSwitch.java index 3537ea6f8..d07147a0f 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attroverridesecondarytable/util/AttroverridesecondarytableSwitch.java +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/attroverridesecondarytable/util/AttroverridesecondarytableSwitch.java @@ -11,6 +11,8 @@ 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.attroverridesecondarytable.*; /** @@ -26,7 +28,7 @@ import org.eclipse.emf.teneo.samples.emf.annotations.attroverridesecondarytable. * @see org.eclipse.emf.teneo.samples.emf.annotations.attroverridesecondarytable.AttroverridesecondarytablePackage * @generated */ -public class AttroverridesecondarytableSwitch<T> { +public class AttroverridesecondarytableSwitch<T> extends Switch<T> { /** * The cached model package * <!-- begin-user-doc --> @@ -48,34 +50,16 @@ public class AttroverridesecondarytableSwitch<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; } /** @@ -85,6 +69,7 @@ public class AttroverridesecondarytableSwitch<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 AttroverridesecondarytablePackage.ADDRESS: { @@ -209,6 +194,7 @@ public class AttroverridesecondarytableSwitch<T> { * @see #doSwitch(org.eclipse.emf.ecore.EObject) * @generated */ + @Override public T defaultCase(EObject object) { return null; } diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/Writer.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/Writer.java index 081978a5d..eae65911a 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/Writer.java +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/Writer.java @@ -161,6 +161,7 @@ public interface Writer extends EObject { * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.EavlibraryPackage#getWriter_Abstract() * @model dataType="org.eclipse.emf.ecore.xml.type.String" * annotation="teneo.jpa appinfo='@Lob'" + * annotation="teneo.jpa.auditing appinfo='@Lob'" * @generated */ String getAbstract(); diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/impl/EavlibraryPackageImpl.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/impl/EavlibraryPackageImpl.java index 5a75d0a07..df70bd087 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/impl/EavlibraryPackageImpl.java +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/impl/EavlibraryPackageImpl.java @@ -492,6 +492,8 @@ public class EavlibraryPackageImpl extends EPackageImpl implements EavlibraryPac createTeneoAnnotations(); // teneo.hibernate createTeneo_1Annotations(); + // teneo.jpa.auditing + createTeneo_2Annotations(); } /** @@ -626,7 +628,7 @@ public class EavlibraryPackageImpl extends EPackageImpl implements EavlibraryPac new String[] { "kind", "element", "name", "city" - }); + }); } /** @@ -660,7 +662,7 @@ public class EavlibraryPackageImpl extends EPackageImpl implements EavlibraryPac source, new String[] { "appinfo", "@Lob" - }); + }); } /** @@ -676,7 +678,23 @@ public class EavlibraryPackageImpl extends EPackageImpl implements EavlibraryPac source, new String[] { "appinfo", "@Fetch(SUBSELECT) @ForeignKey(name=\"schrijvers\")" - }); + }); + } + + /** + * Initializes the annotations for <b>teneo.jpa.auditing</b>. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void createTeneo_2Annotations() { + String source = "teneo.jpa.auditing"; + addAnnotation + (getWriter_Abstract(), + source, + new String[] { + "appinfo", "@Lob" + }); } } //EavlibraryPackageImpl diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/model/eavlibrary.ecore b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/model/eavlibrary.ecore index c8ab3545b..5b567499d 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/model/eavlibrary.ecore +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/model/eavlibrary.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="eavlibrary" - nsURI="http://www.eclipse.org/emf/teneo/samples/emf/annotations/eavlibrary" nsPrefix="eavlibrary"> +<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="eavlibrary" nsURI="http://www.eclipse.org/emf/teneo/samples/emf/annotations/eavlibrary" + nsPrefix="eavlibrary"> <eClassifiers xsi:type="ecore:EClass" name="Book"> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData"> <details key="name" value="Book"/> @@ -139,6 +138,9 @@ <eAnnotations source="teneo.jpa"> <details key="appinfo" value="@Lob"/> </eAnnotations> + <eAnnotations source="teneo.jpa.auditing"> + <details key="appinfo" value="@Lob"/> + </eAnnotations> </eStructuralFeatures> </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="Pen"> diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/model/eavlibrary.genmodel b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/model/eavlibrary.genmodel index cf46b4061..ad40c5c52 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/model/eavlibrary.genmodel +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/model/eavlibrary.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="Eavlibrary" importerID="org.eclipse.emf.importer.ecore" - complianceLevel="6.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="Eavlibrary" importerID="org.eclipse.emf.importer.ecore" complianceLevel="6.0" + copyrightFields="false"> <foreignModel>eavlibrary.ecore</foreignModel> <genPackages prefix="Eavlibrary" basePackage="org.eclipse.emf.teneo.samples.emf.annotations" resource="XML" disposableProviderFactory="true" ecorePackage="eavlibrary.ecore#/"> diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/util/EavlibrarySwitch.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/util/EavlibrarySwitch.java index bfd6968b9..759604a1f 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/util/EavlibrarySwitch.java +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/util/EavlibrarySwitch.java @@ -11,6 +11,8 @@ 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.eavlibrary.*; /** @@ -26,7 +28,7 @@ import org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.*; * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.EavlibraryPackage * @generated */ -public class EavlibrarySwitch<T> { +public class EavlibrarySwitch<T> extends Switch<T> { /** * The cached model package * <!-- begin-user-doc --> @@ -48,34 +50,16 @@ public class EavlibrarySwitch<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; } /** @@ -85,6 +69,7 @@ public class EavlibrarySwitch<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 EavlibraryPackage.BOOK: { @@ -207,6 +192,7 @@ public class EavlibrarySwitch<T> { * @see #doSwitch(org.eclipse.emf.ecore.EObject) * @generated */ + @Override public T defaultCase(EObject object) { return null; } 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="org.eclipse.emf.teneo.hibernate.mapping.EcoreModelElementType")"/> </eAnnotations> + <eAnnotations source="teneo.jpa.auditing"> + <details key="value" value="@External(type="org.eclipse.emf.teneo.hibernate.mapping.EcoreModelElementType")"/> + </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; } diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/extralazy/model/extralazy.ecore b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/extralazy/model/extralazy.ecore index d3819bc68..fd20e0ce7 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/extralazy/model/extralazy.ecore +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/extralazy/model/extralazy.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="extralazy" - nsURI="http://www.eclipse.org/emf/teneo/samples/emf/annotations/extralazy" nsPrefix="extralazy"> +<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="extralazy" nsURI="http://www.eclipse.org/emf/teneo/samples/emf/annotations/extralazy" + nsPrefix="extralazy"> <eClassifiers xsi:type="ecore:EClass" name="Book"> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData"> <details key="name" value="Book"/> diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/extralazy/model/extralazy.genmodel b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/extralazy/model/extralazy.genmodel index 7dee9dce7..e99e748ba 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/extralazy/model/extralazy.genmodel +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/extralazy/model/extralazy.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="Extralazy" importerID="org.eclipse.xsd.ecore.importer" - 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="Extralazy" importerID="org.eclipse.xsd.ecore.importer" complianceLevel="5.0" + copyrightFields="false"> <foreignModel>extralazy.xsd</foreignModel> <genPackages prefix="Extralazy" basePackage="org.eclipse.emf.teneo.samples.emf.annotations" resource="XML" disposableProviderFactory="true" ecorePackage="extralazy.ecore#/"> diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/extralazy/util/ExtralazySwitch.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/extralazy/util/ExtralazySwitch.java index 74ae61855..452a2be6f 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/extralazy/util/ExtralazySwitch.java +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/extralazy/util/ExtralazySwitch.java @@ -11,6 +11,8 @@ 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.extralazy.*; /** @@ -26,7 +28,7 @@ import org.eclipse.emf.teneo.samples.emf.annotations.extralazy.*; * @see org.eclipse.emf.teneo.samples.emf.annotations.extralazy.ExtralazyPackage * @generated */ -public class ExtralazySwitch<T> { +public class ExtralazySwitch<T> extends Switch<T> { /** * The cached model package * <!-- begin-user-doc --> @@ -48,34 +50,16 @@ public class ExtralazySwitch<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; } /** @@ -85,6 +69,7 @@ public class ExtralazySwitch<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 ExtralazyPackage.BOOK: { @@ -144,6 +129,7 @@ public class ExtralazySwitch<T> { * @see #doSwitch(org.eclipse.emf.ecore.EObject) * @generated */ + @Override public T defaultCase(EObject object) { return null; } diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/SpecificDocument.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/SpecificDocument.java index 06579e4b6..a157e9699 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/SpecificDocument.java +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/SpecificDocument.java @@ -21,6 +21,7 @@ package org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass; * * @see org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.MappedsuperclassPackage#getSpecificDocument() * @model annotation="teneo.jpa appinfo='@Entity\n @AttributeOverrides({@AttributeOverride(name=\"myName\", \n\t\tcolumn=@Column(name=\"PARENTDOCUMENT_NAME\", length=\"50\"))})\n\t\t\t'" + * annotation="teneo.jpa.auditing appinfo='@Entity\n @AttributeOverrides({@AttributeOverride(name=\"myName\", \n\t\tcolumn=@Column(name=\"PARENTDOCUMENT_NAME\", length=\"50\"))})\n\t\t\t'" * extendedMetaData="name='SpecificDocument' kind='elementOnly'" * @generated */ diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/impl/MappedsuperclassPackageImpl.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/impl/MappedsuperclassPackageImpl.java index 51b114bd5..e09359799 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/impl/MappedsuperclassPackageImpl.java +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/impl/MappedsuperclassPackageImpl.java @@ -333,6 +333,8 @@ public class MappedsuperclassPackageImpl extends EPackageImpl implements Mappeds createTeneoAnnotations(); // http:///org/eclipse/emf/ecore/util/ExtendedMetaData createExtendedMetaDataAnnotations(); + // teneo.jpa.auditing + createTeneo_1Annotations(); } /** @@ -372,7 +374,7 @@ public class MappedsuperclassPackageImpl extends EPackageImpl implements Mappeds source, new String[] { "appinfo", "@Entity\n @AttributeOverrides({@AttributeOverride(name=\"myName\", \n\t\tcolumn=@Column(name=\"PARENTDOCUMENT_NAME\", length=\"50\"))})\n\t\t\t" - }); + }); addAnnotation (testReferenceEClass, source, @@ -437,7 +439,7 @@ public class MappedsuperclassPackageImpl extends EPackageImpl implements Mappeds new String[] { "kind", "element", "name", "myName" - }); + }); addAnnotation (specificDocumentEClass, source, @@ -468,4 +470,20 @@ public class MappedsuperclassPackageImpl extends EPackageImpl implements Mappeds }); } + /** + * 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 + (specificDocumentEClass, + source, + new String[] { + "appinfo", "@Entity\n @AttributeOverrides({@AttributeOverride(name=\"myName\", \n\t\tcolumn=@Column(name=\"PARENTDOCUMENT_NAME\", length=\"50\"))})\n\t\t\t" + }); + } + } //MappedsuperclassPackageImpl diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/model/mappedsuperclass.ecore b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/model/mappedsuperclass.ecore index b775be70e..8bf2f5728 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/model/mappedsuperclass.ecore +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/model/mappedsuperclass.ecore @@ -1,8 +1,6 @@ <?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="mappedsuperclass" - nsURI="http://www.eclipse.org/emf/teneo/samples/emf/annotations/mappedsuperclass" +<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="mappedsuperclass" nsURI="http://www.eclipse.org/emf/teneo/samples/emf/annotations/mappedsuperclass" nsPrefix="mappedsuperclass"> <eClassifiers xsi:type="ecore:EClass" name="AddIDDocument" eSuperTypes="#//Document"> <eAnnotations source="teneo.jpa"> @@ -65,6 +63,9 @@ <eAnnotations source="teneo.jpa"> <details key="appinfo" value="@Entity
 @AttributeOverrides({@AttributeOverride(name="myName", 
		column=@Column(name="PARENTDOCUMENT_NAME", length="50"))})
			"/> </eAnnotations> + <eAnnotations source="teneo.jpa.auditing"> + <details key="appinfo" value="@Entity
 @AttributeOverrides({@AttributeOverride(name="myName", 
		column=@Column(name="PARENTDOCUMENT_NAME", length="50"))})
			"/> + </eAnnotations> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData"> <details key="name" value="SpecificDocument"/> <details key="kind" value="elementOnly"/> diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/model/mps.genmodel b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/model/mps.genmodel index 5633ef58a..af7bbe4d2 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/model/mps.genmodel +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/model/mps.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" copyrightText="" - modelDirectory="/org.eclipse.emf.teneo.samples/src" modelPluginID="org.eclipse.emf.teneo.samples" - modelName="Mps" importerID="org.eclipse.xsd.ecore.importer" complianceLevel="5.0"> +<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" copyrightText="" modelDirectory="/org.eclipse.emf.teneo.samples/src" + modelPluginID="org.eclipse.emf.teneo.samples" modelName="Mps" importerID="org.eclipse.xsd.ecore.importer" + complianceLevel="5.0"> <foreignModel>mps.xsd</foreignModel> <genPackages prefix="Mappedsuperclass" basePackage="org.eclipse.emf.teneo.samples.emf.annotations" resource="XML" disposableProviderFactory="true" ecorePackage="mappedsuperclass.ecore#/"> diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/model/mps.xsd b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/model/mps.xsd index 5f9cbad2e..5fca1145c 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/model/mps.xsd +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/model/mps.xsd @@ -63,6 +63,10 @@ @AttributeOverrides({@AttributeOverride(name="myName", column=@Column(name="PARENTDOCUMENT_NAME", length="50"))}) </xsd:appinfo> + <xsd:appinfo source="teneo.jpa.auditing">@Entity + @AttributeOverrides({@AttributeOverride(name="myName", + column=@Column(name="PARENTDOCUMENT_NAME", length="50"))}) + </xsd:appinfo> </xsd:annotation> <xsd:complexContent> <xsd:extension base="this:ParentDocument"> diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/util/MappedsuperclassSwitch.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/util/MappedsuperclassSwitch.java index 4c15d2c6a..19d42d45e 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/util/MappedsuperclassSwitch.java +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/util/MappedsuperclassSwitch.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.mappedsuperclass.*; import org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.AddIDDocument; import org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.Document; import org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.MappedsuperclassPackage; @@ -30,7 +33,7 @@ import org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.TestRefere * @see org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.MappedsuperclassPackage * @generated */ -public class MappedsuperclassSwitch<T> { +public class MappedsuperclassSwitch<T> extends Switch<T> { /** * The cached model package * <!-- begin-user-doc --> @@ -52,34 +55,16 @@ public class MappedsuperclassSwitch<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; } /** @@ -89,6 +74,7 @@ public class MappedsuperclassSwitch<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 MappedsuperclassPackage.ADD_ID_DOCUMENT: { @@ -215,6 +201,7 @@ public class MappedsuperclassSwitch<T> { * @see #doSwitch(org.eclipse.emf.ecore.EObject) * @generated */ + @Override public T defaultCase(EObject object) { return null; } diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/jpa2/collectiontable/Item.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/jpa2/collectiontable/Item.java index df19e963b..616a1ce86 100644 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/jpa2/collectiontable/Item.java +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/jpa2/collectiontable/Item.java @@ -41,6 +41,7 @@ public interface Item extends EObject { * @see org.eclipse.emf.teneo.samples.emf.jpa2.collectiontable.CollectiontablePackage#getItem_Names() * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String" required="true" * annotation="teneo.jpa value='@CollectionTable(name=\"NamesTable\" joinColumns={@JoinColumn(name=\"joinColumn1\")})\n'" + * annotation="teneo.jpa.auditing value='@CollectionTable(name=\"AuditNamesTable\" joinColumns={@JoinColumn(name=\"joinColumn1\")})\n'" * @generated */ EList<String> getNames(); @@ -57,6 +58,7 @@ public interface Item extends EObject { * @return the value of the '<em>Items</em>' reference list. * @see org.eclipse.emf.teneo.samples.emf.jpa2.collectiontable.CollectiontablePackage#getItem_Items() * @model annotation="teneo.jpa value='@Embedded\n@CollectionTable(name=\"EmbeddedItemsTable\" joinColumns={@JoinColumn(name=\"MYJC\")})\n'" + * annotation="teneo.jpa.auditing value='@Embedded\n@CollectionTable(name=\"EmbItemsAuditTable\" joinColumns={@JoinColumn(name=\"MYJC\")})\n'" * @generated */ EList<EmbeddedItem> getItems(); diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/jpa2/collectiontable/impl/CollectiontablePackageImpl.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/jpa2/collectiontable/impl/CollectiontablePackageImpl.java index 9dbf4216b..8235101db 100644 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/jpa2/collectiontable/impl/CollectiontablePackageImpl.java +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/jpa2/collectiontable/impl/CollectiontablePackageImpl.java @@ -232,6 +232,8 @@ public class CollectiontablePackageImpl extends EPackageImpl implements Collecti // Create annotations // teneo.jpa createTeneoAnnotations(); + // teneo.jpa.auditing + createTeneo_1Annotations(); } /** @@ -247,12 +249,34 @@ public class CollectiontablePackageImpl extends EPackageImpl implements Collecti source, new String[] { "value", "@CollectionTable(name=\"NamesTable\" joinColumns={@JoinColumn(name=\"joinColumn1\")})\n" - }); + }); addAnnotation (getItem_Items(), source, new String[] { "value", "@Embedded\n@CollectionTable(name=\"EmbeddedItemsTable\" joinColumns={@JoinColumn(name=\"MYJC\")})\n" + }); + } + + /** + * 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 + (getItem_Names(), + source, + new String[] { + "value", "@CollectionTable(name=\"AuditNamesTable\" joinColumns={@JoinColumn(name=\"joinColumn1\")})\n" + }); + addAnnotation + (getItem_Items(), + source, + new String[] { + "value", "@Embedded\n@CollectionTable(name=\"EmbItemsAuditTable\" joinColumns={@JoinColumn(name=\"MYJC\")})\n" }); } diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/jpa2/collectiontable/model/collectiontable.ecore b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/jpa2/collectiontable/model/collectiontable.ecore index abe724299..af4e08502 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/jpa2/collectiontable/model/collectiontable.ecore +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/jpa2/collectiontable/model/collectiontable.ecore @@ -1,20 +1,25 @@ <?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="collectiontable" - nsURI="http://www.eclipse.org/emf/teneo/samples/emf/jpa2/collectiontable" nsPrefix="collectiontable"> +<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="collectiontable" nsURI="http://www.eclipse.org/emf/teneo/samples/emf/jpa2/collectiontable" + nsPrefix="collectiontable"> <eClassifiers xsi:type="ecore:EClass" name="Item"> <eStructuralFeatures xsi:type="ecore:EAttribute" name="names" unique="false" lowerBound="1" upperBound="-1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"> <eAnnotations source="teneo.jpa"> <details key="value" value="@CollectionTable(name="NamesTable" joinColumns={@JoinColumn(name="joinColumn1")})
"/> </eAnnotations> + <eAnnotations source="teneo.jpa.auditing"> + <details key="value" value="@CollectionTable(name="AuditNamesTable" joinColumns={@JoinColumn(name="joinColumn1")})
"/> + </eAnnotations> </eStructuralFeatures> <eStructuralFeatures xsi:type="ecore:EReference" name="items" upperBound="-1" eType="#//EmbeddedItem"> <eAnnotations source="teneo.jpa"> <details key="value" value="@Embedded
@CollectionTable(name="EmbeddedItemsTable" joinColumns={@JoinColumn(name="MYJC")})
"/> </eAnnotations> + <eAnnotations source="teneo.jpa.auditing"> + <details key="value" value="@Embedded
@CollectionTable(name="EmbItemsAuditTable" joinColumns={@JoinColumn(name="MYJC")})
"/> + </eAnnotations> </eStructuralFeatures> </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="EmbeddedItem"> diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/jpa2/collectiontable/model/collectiontable.genmodel b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/jpa2/collectiontable/model/collectiontable.genmodel index b09f5d9a9..acd1bc9ad 100644 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/jpa2/collectiontable/model/collectiontable.genmodel +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/jpa2/collectiontable/model/collectiontable.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="Collectiontable" 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="Collectiontable" importerID="org.eclipse.emf.importer.ecore" complianceLevel="5.0" + copyrightFields="false"> <foreignModel>collectiontable.ecore</foreignModel> <genPackages prefix="Collectiontable" basePackage="org.eclipse.emf.teneo.samples.emf.jpa2" disposableProviderFactory="true" ecorePackage="collectiontable.ecore#/"> diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/jpa2/collectiontable/util/CollectiontableSwitch.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/jpa2/collectiontable/util/CollectiontableSwitch.java index 976c7a82f..112266b28 100644 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/jpa2/collectiontable/util/CollectiontableSwitch.java +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/jpa2/collectiontable/util/CollectiontableSwitch.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.jpa2.collectiontable.*; import org.eclipse.emf.teneo.samples.emf.jpa2.collectiontable.CollectiontablePackage; import org.eclipse.emf.teneo.samples.emf.jpa2.collectiontable.EmbeddedItem; import org.eclipse.emf.teneo.samples.emf.jpa2.collectiontable.Item; @@ -27,7 +30,7 @@ import org.eclipse.emf.teneo.samples.emf.jpa2.collectiontable.Item; * @see org.eclipse.emf.teneo.samples.emf.jpa2.collectiontable.CollectiontablePackage * @generated */ -public class CollectiontableSwitch<T> { +public class CollectiontableSwitch<T> extends Switch<T> { /** * The cached model package * <!-- begin-user-doc --> @@ -49,34 +52,16 @@ public class CollectiontableSwitch<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 CollectiontableSwitch<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 CollectiontablePackage.ITEM: { @@ -145,6 +131,7 @@ public class CollectiontableSwitch<T> { * @see #doSwitch(org.eclipse.emf.ecore.EObject) * @generated */ + @Override public T defaultCase(EObject object) { return null; } |