diff options
Diffstat (limited to 'examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/lob/impl/LobPackageImpl.java')
-rw-r--r-- | examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/lob/impl/LobPackageImpl.java | 482 |
1 files changed, 226 insertions, 256 deletions
diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/lob/impl/LobPackageImpl.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/lob/impl/LobPackageImpl.java index 440e47367..97b6abcd7 100644 --- a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/lob/impl/LobPackageImpl.java +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/lob/impl/LobPackageImpl.java @@ -2,7 +2,7 @@ * <copyright>
* </copyright>
*
- * $Id: LobPackageImpl.java,v 1.1 2006/07/11 16:56:58 mtaal Exp $
+ * $Id: LobPackageImpl.java,v 1.2 2006/09/29 12:30:05 mtaal Exp $
*/
package org.eclipse.emf.teneo.samples.emf.annotations.lob.impl;
@@ -18,317 +18,287 @@ import org.eclipse.emf.teneo.samples.emf.annotations.lob.LobFactory; import org.eclipse.emf.teneo.samples.emf.annotations.lob.LobPackage;
import org.eclipse.emf.teneo.samples.emf.annotations.lob.Person;
-/**
+/** * <!-- begin-user-doc -->
* An implementation of the model <b>Package</b>.
* <!-- end-user-doc -->
- * @generated
+ * @generated */
public class LobPackageImpl extends EPackageImpl implements LobPackage {
- /**
+ /** * <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @generated
+ * @generated */
private EClass personEClass = null;
- /**
- * Creates an instance of the model <b>Package</b>, registered with
- * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
- * package URI value.
- * <p>Note: the correct way to create the package is via the static
- * factory method {@link #init init()}, which also performs
- * initialization of the package, or returns the registered package,
- * if one already exists.
+ /** + * Creates an instance of the model <b>Package</b>, registered with + * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package + * package URI value. + * <p>Note: the correct way to create the package is via the static + * factory method {@link #init init()}, which also performs + * initialization of the package, or returns the registered package, + * if one already exists. * <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see org.eclipse.emf.ecore.EPackage.Registry
- * @see org.eclipse.emf.teneo.samples.emf.annotations.lob.LobPackage#eNS_URI
- * @see #init()
- * @generated
+ * @see org.eclipse.emf.ecore.EPackage.Registry + * @see org.eclipse.emf.teneo.samples.emf.annotations.lob.LobPackage#eNS_URI + * @see #init() + * @generated */
- private LobPackageImpl() {
- super(eNS_URI, LobFactory.eINSTANCE);
- }
-
- /**
+ private LobPackageImpl() { + super(eNS_URI, LobFactory.eINSTANCE); + } + + /** * <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @generated
+ * @generated */
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. 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. * <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see #eNS_URI
- * @see #createPackageContents()
- * @see #initializePackageContents()
- * @generated
+ * @see #eNS_URI + * @see #createPackageContents() + * @see #initializePackageContents() + * @generated */
- public static LobPackage init() {
- if (isInited) return (LobPackage)EPackage.Registry.INSTANCE.getEPackage(LobPackage.eNS_URI);
-
- // Obtain or create and register package
- LobPackageImpl theLobPackage = (LobPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof LobPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new LobPackageImpl());
-
- isInited = true;
-
- // Initialize simple dependencies
- XMLTypePackage.eINSTANCE.eClass();
-
- // Create package meta-data objects
- theLobPackage.createPackageContents();
-
- // Initialize created meta-data
- theLobPackage.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- theLobPackage.freeze();
-
- return theLobPackage;
- }
-
- /**
+ public static LobPackage init() { + if (isInited) return (LobPackage)EPackage.Registry.INSTANCE.getEPackage(LobPackage.eNS_URI); + + // Obtain or create and register package + LobPackageImpl theLobPackage = (LobPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof LobPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new LobPackageImpl()); + + isInited = true; + + // Initialize simple dependencies + XMLTypePackage.eINSTANCE.eClass(); + + // Create package meta-data objects + theLobPackage.createPackageContents(); + + // Initialize created meta-data + theLobPackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theLobPackage.freeze(); + + return theLobPackage; + } + + /** * <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @generated
+ * @generated */
- public EClass getPerson() {
- return personEClass;
- }
-
- /**
+ public EClass getPerson() { + return personEClass; + } + + /** * <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @generated
+ * @generated */
- public EAttribute getPerson_Id() {
- return (EAttribute)personEClass.getEStructuralFeatures().get(0);
- }
-
- /**
+ public EAttribute getPerson_Id() { + return (EAttribute)personEClass.getEStructuralFeatures().get(0); + } + + /** * <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @generated
+ * @generated */
- public EAttribute getPerson_Name() {
- return (EAttribute)personEClass.getEStructuralFeatures().get(1);
- }
-
- /**
+ public EAttribute getPerson_Name() { + return (EAttribute)personEClass.getEStructuralFeatures().get(1); + } + + /** * <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @generated
+ * @generated */
- public EAttribute getPerson_Address() {
- return (EAttribute)personEClass.getEStructuralFeatures().get(2);
- }
-
- /**
+ public EAttribute getPerson_Address() { + return (EAttribute)personEClass.getEStructuralFeatures().get(2); + } + + /** * <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @generated
+ * @generated */
- public EAttribute getPerson_Photo() {
- return (EAttribute)personEClass.getEStructuralFeatures().get(3);
- }
-
- /**
+ public EAttribute getPerson_Photo() { + return (EAttribute)personEClass.getEStructuralFeatures().get(3); + } + + /** * <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @generated
+ * @generated */
- public LobFactory getLobFactory() {
- return (LobFactory)getEFactoryInstance();
- }
-
- /**
+ public LobFactory getLobFactory() { + return (LobFactory)getEFactoryInstance(); + } + + /** * <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @generated
+ * @generated */
private boolean isCreated = false;
- /**
- * Creates the meta-model objects for the package. This method is
- * guarded to have no affect on any invocation but its first.
+ /** + * Creates the meta-model objects for the package. This method is + * guarded to have no affect on any invocation but its first. * <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @generated
+ * @generated */
- public void createPackageContents() {
- if (isCreated) return;
- isCreated = true;
-
- // Create classes and their features
- personEClass = createEClass(PERSON);
- createEAttribute(personEClass, PERSON__ID);
- createEAttribute(personEClass, PERSON__NAME);
- createEAttribute(personEClass, PERSON__ADDRESS);
- createEAttribute(personEClass, PERSON__PHOTO);
- }
-
- /**
+ public void createPackageContents() { + if (isCreated) return; + isCreated = true; + + // Create classes and their features + personEClass = createEClass(PERSON); + createEAttribute(personEClass, PERSON__ID); + createEAttribute(personEClass, PERSON__NAME); + createEAttribute(personEClass, PERSON__ADDRESS); + createEAttribute(personEClass, PERSON__PHOTO); + } + + /** * <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @generated
+ * @generated */
private boolean isInitialized = false;
- /**
- * Complete the initialization of the package and its meta-model. This
- * method is guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void initializePackageContents() {
- if (isInitialized) return;
- isInitialized = true;
-
- // Initialize package
- setName(eNAME);
- setNsPrefix(eNS_PREFIX);
- setNsURI(eNS_URI);
-
- // Obtain other dependent packages
- XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI);
-
- // Add supertypes to classes
-
- // Initialize classes and features; add operations and parameters
- initEClass(personEClass, Person.class, "Person", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getPerson_Id(), theXMLTypePackage.getLong(), "id", null, 1, 1, Person.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getPerson_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, Person.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getPerson_Address(), theXMLTypePackage.getString(), "address", null, 0, 1, Person.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getPerson_Photo(), theXMLTypePackage.getBase64Binary(), "photo", null, 0, 1, Person.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- // Create resource
- createResource(eNS_URI);
-
- // Create annotations
- // http:///org/eclipse/emf/ecore/util/ExtendedMetaData
- createExtendedMetaDataAnnotations();
- // http://annotation.elver.org/Id
- createIdAnnotations();
- // http://annotation.elver.org/Lob
- createLobAnnotations();
- // http://annotation.elver.org/Column
- createColumnAnnotations();
- }
-
- /**
- * Initializes the annotations for <b>http:///org/eclipse/emf/ecore/util/ExtendedMetaData</b>.
+ /** + * Complete the initialization of the package and its meta-model. This + * method is guarded to have no affect on any invocation but its first. * <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @generated
+ * @generated */
- protected void createExtendedMetaDataAnnotations() {
- String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData";
- addAnnotation
- (personEClass,
- source,
- new String[] {
- "name", "Person",
- "kind", "elementOnly"
- });
- addAnnotation
- (getPerson_Id(),
- source,
- new String[] {
- "kind", "element",
- "name", "id"
- });
- addAnnotation
- (getPerson_Name(),
- source,
- new String[] {
- "kind", "element",
- "name", "name"
- });
- addAnnotation
- (getPerson_Address(),
- source,
- new String[] {
- "kind", "element",
- "name", "address"
- });
- addAnnotation
- (getPerson_Photo(),
- source,
- new String[] {
- "kind", "element",
- "name", "photo"
- });
- }
-
- /**
- * Initializes the annotations for <b>http://annotation.elver.org/Id</b>.
+ public void initializePackageContents() { + if (isInitialized) return; + isInitialized = true; + + // Initialize package + setName(eNAME); + setNsPrefix(eNS_PREFIX); + setNsURI(eNS_URI); + + // Obtain other dependent packages + XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI); + + // Add supertypes to classes + + // Initialize classes and features; add operations and parameters + initEClass(personEClass, Person.class, "Person", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getPerson_Id(), theXMLTypePackage.getLong(), "id", null, 1, 1, Person.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getPerson_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, Person.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getPerson_Address(), theXMLTypePackage.getString(), "address", null, 0, 1, Person.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getPerson_Photo(), theXMLTypePackage.getBase64Binary(), "photo", null, 0, 1, Person.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + // Create resource + createResource(eNS_URI); + + // Create annotations + // http:///org/eclipse/emf/ecore/util/ExtendedMetaData + createExtendedMetaDataAnnotations(); + // teneo.jpa + createTeneoAnnotations(); + } + + /** + * Initializes the annotations for <b>http:///org/eclipse/emf/ecore/util/ExtendedMetaData</b>. * <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @generated
+ * @generated */
- protected void createIdAnnotations() {
- String source = "http://annotation.elver.org/Id";
- addAnnotation
- (getPerson_Id(),
- source,
- new String[] {
- "appinfo", "true"
- });
- }
-
- /**
- * Initializes the annotations for <b>http://annotation.elver.org/Lob</b>.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected void createLobAnnotations() {
- String source = "http://annotation.elver.org/Lob";
- addAnnotation
- (getPerson_Address(),
- source,
- new String[] {
- "appinfo", "true"
- });
- addAnnotation
- (getPerson_Photo(),
- source,
- new String[] {
- "appinfo", "true"
- });
- }
-
- /**
- * Initializes the annotations for <b>http://annotation.elver.org/Column</b>.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected void createColumnAnnotations() {
- String source = "http://annotation.elver.org/Column";
- addAnnotation
- (getPerson_Photo(),
- source,
- new String[] {
- "length", "1000000"
- });
- }
-
+ protected void createExtendedMetaDataAnnotations() { + String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData"; + addAnnotation + (personEClass, + source, + new String[] { + "name", "Person", + "kind", "elementOnly" + }); + addAnnotation + (getPerson_Id(), + source, + new String[] { + "kind", "element", + "name", "id" + }); + addAnnotation + (getPerson_Name(), + source, + new String[] { + "kind", "element", + "name", "name" + }); + addAnnotation + (getPerson_Address(), + source, + new String[] { + "kind", "element", + "name", "address" + }); + addAnnotation + (getPerson_Photo(), + source, + new String[] { + "kind", "element", + "name", "photo" + }); + } + + /** + * Initializes the annotations for <b>teneo.jpa</b>. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void createTeneoAnnotations() { + String source = "teneo.jpa"; + addAnnotation + (getPerson_Id(), + source, + new String[] { + "appinfo", "@Id" + }); + addAnnotation + (getPerson_Address(), + source, + new String[] { + "appinfo", "@Lob" + }); + addAnnotation + (getPerson_Photo(), + source, + new String[] { + "appinfo", "\n\t\t\t\t\t\t@Lob\n\t\t\t\t\t\t@Column(length=1000000)\n\t\t\t\t" + }); + } + } //LobPackageImpl
|