Search in sources :

Example 26 with EReference

use of org.eclipse.emf.ecore.EReference in project BIMserver by opensourceBIM.

the class StreamingCheckinDatabaseAction method fixInverses.

@SuppressWarnings("unchecked")
private void fixInverses(PackageMetaData packageMetaData, long newRoid) throws QueryException, JsonParseException, JsonMappingException, IOException, BimserverDatabaseException {
    // TODO remove cache, this is essentially a big part of the model in memory again
    Map<Long, HashMapVirtualObject> cache = new HashMap<Long, HashMapVirtualObject>();
    Query query = new Query("Inverses fixer", packageMetaData);
    int nrTypes = 0;
    Set<EClass> uniqueTypes = new HashSet<>();
    for (EClass eClass : deserializer.getSummaryMap().keySet()) {
        if (packageMetaData.hasInverses(eClass)) {
            QueryPart queryPart = query.createQueryPart();
            queryPart.addType(eClass, true);
            uniqueTypes.add(eClass);
            nrTypes++;
            for (EReference eReference : packageMetaData.getAllHasInverseReferences(eClass)) {
                Include include = queryPart.createInclude();
                include.addType(eClass, true);
                include.addField(eReference.getName());
            }
        }
    }
    QueryObjectProvider queryObjectProvider = new QueryObjectProvider(getDatabaseSession(), bimServer, query, Collections.singleton(newRoid), packageMetaData);
    HashMapVirtualObject next = queryObjectProvider.next();
    EClass lastEClass = null;
    int currentType = 0;
    while (next != null) {
        if (next.eClass() != lastEClass && uniqueTypes.contains(next.eClass()) && queryObjectProvider.getStackFrame() instanceof QueryTypeStackFrame) {
            lastEClass = next.eClass();
            currentType++;
            setProgress("Generating inverses", (100 * currentType / nrTypes));
        }
        if (packageMetaData.hasInverses(next.eClass())) {
            for (EReference eReference : packageMetaData.getAllHasInverseReferences(next.eClass())) {
                Object reference = next.eGet(eReference);
                if (reference != null) {
                    if (eReference.isMany()) {
                        List<Long> references = (List<Long>) reference;
                        for (Long refOid : references) {
                            fixInverses(packageMetaData, newRoid, cache, next, eReference, refOid);
                        }
                    } else {
                        fixInverses(packageMetaData, newRoid, cache, next, eReference, (Long) reference);
                    }
                }
            }
        }
        next = queryObjectProvider.next();
    }
    setProgress("Storing data", -1);
    for (HashMapVirtualObject referencedObject : cache.values()) {
        referencedObject.saveOverwrite();
    }
}
Also used : OldQuery(org.bimserver.database.OldQuery) Query(org.bimserver.database.queries.om.Query) HashMap(java.util.HashMap) QueryPart(org.bimserver.database.queries.om.QueryPart) Include(org.bimserver.database.queries.om.Include) EClass(org.eclipse.emf.ecore.EClass) HashMapVirtualObject(org.bimserver.shared.HashMapVirtualObject) QueryObjectProvider(org.bimserver.database.queries.QueryObjectProvider) AtomicLong(java.util.concurrent.atomic.AtomicLong) QueryTypeStackFrame(org.bimserver.database.queries.QueryTypeStackFrame) HashMapVirtualObject(org.bimserver.shared.HashMapVirtualObject) List(java.util.List) EReference(org.eclipse.emf.ecore.EReference) HashSet(java.util.HashSet)

Example 27 with EReference

use of org.eclipse.emf.ecore.EReference in project BIMserver by opensourceBIM.

the class StreamingCheckinDatabaseAction method fixInverses.

private void fixInverses(PackageMetaData packageMetaData, long newRoid, Map<Long, HashMapVirtualObject> cache, HashMapVirtualObject next, EReference eReference, long refOid) throws JsonParseException, JsonMappingException, IOException, QueryException, BimserverDatabaseException {
    HashMapVirtualObject referencedObject = cache.get(refOid);
    if (referencedObject == null) {
        referencedObject = getByOid(packageMetaData, getDatabaseSession(), newRoid, refOid);
        if (referencedObject == null) {
            throw new BimserverDatabaseException("Referenced object with oid " + refOid + " (" + getDatabaseSession().getEClassForOid(refOid).getName() + ")" + ", referenced from " + next.eClass().getName() + " not found");
        }
        cache.put(refOid, referencedObject);
    }
    EReference oppositeReference = packageMetaData.getInverseOrOpposite(referencedObject.eClass(), eReference);
    if (oppositeReference == null) {
        if (eReference.getName().equals("RelatedElements") && referencedObject.eClass().getName().equals("IfcSpace")) {
        // Ignore, IfcSpace should have  a field called RelatedElements, but it doesn't.
        } else {
        // LOGGER.error("No opposite " + eReference.getName() + " found");
        }
    } else {
        if (oppositeReference.isMany()) {
            Object existingList = referencedObject.eGet(oppositeReference);
            if (existingList != null) {
                int currentSize = ((List<?>) existingList).size();
                referencedObject.setListItemReference(oppositeReference, currentSize, next.eClass(), next.getOid(), 0);
            } else {
                referencedObject.setListItemReference(oppositeReference, 0, next.eClass(), next.getOid(), 0);
            }
        } else {
            referencedObject.setReference(oppositeReference, next.getOid(), 0);
        }
    }
}
Also used : BimserverDatabaseException(org.bimserver.BimserverDatabaseException) HashMapVirtualObject(org.bimserver.shared.HashMapVirtualObject) HashMapVirtualObject(org.bimserver.shared.HashMapVirtualObject) List(java.util.List) EReference(org.eclipse.emf.ecore.EReference)

Example 28 with EReference

use of org.eclipse.emf.ecore.EReference in project BIMserver by opensourceBIM.

the class Step0000 method migrate.

@Override
public void migrate(Schema schema, DatabaseSession databaseSession) {
    this.schema = schema;
    storePackage = schema.createEPackage("store");
    createUserTypeEnum();
    createSIPrefixEnum();
    createObjectStateEnum();
    project = schema.createEClass(storePackage, "Project");
    user = schema.createEClass(storePackage, "User");
    revisionClass = schema.createEClass(storePackage, "Revision");
    concreteRevisionClass = schema.createEClass(storePackage, "ConcreteRevision");
    geoTagClass = schema.createEClass(storePackage, "GeoTag");
    checkoutClass = schema.createEClass(storePackage, "Checkout");
    serverSettings = schema.createEClass(storePackage, "ServerSettings");
    userSettings = schema.createEClass(storePackage, "UserSettings");
    createProjectClass();
    createUserClass();
    createCheckoutClass();
    createGeoTagClass();
    createConcreteRevisionClass();
    createRevisionClass();
    createServerSettingsClass();
    userHasRightsOn.setEOpposite(projectHasAuthorizedUsers);
    projectHasAuthorizedUsers.setEOpposite(userHasRightsOn);
    revisionProject.setEOpposite(projectRevisions);
    projectRevisions.setEOpposite(revisionProject);
    checkoutProject.setEOpposite(projectCheckouts);
    projectCheckouts.setEOpposite(checkoutProject);
    checkoutRevision.setEOpposite(revisionCheckouts);
    revisionCheckouts.setEOpposite(checkoutRevision);
    revisionUser.setEOpposite(userRevisions);
    userRevisions.setEOpposite(revisionUser);
    revisionConcreteRevisions.setEOpposite(concreteRevisionRevisions);
    concreteRevisionRevisions.setEOpposite(revisionConcreteRevisions);
    concreteRevisionProject.setEOpposite(projectConcreteRevisions);
    projectConcreteRevisions.setEOpposite(concreteRevisionProject);
    projectGeoTag.setEOpposite(geoTagProjects);
    geoTagProjects.setEOpposite(projectGeoTag);
    projectParentProject.setEOpposite(projectSubProjects);
    projectSubProjects.setEOpposite(projectParentProject);
    EPackage logPackage = schema.createEPackage("log");
    EEnum accessMethodEnum = schema.createEEnum(logPackage, "AccessMethod");
    schema.createEEnumLiteral(accessMethodEnum, "SOAP");
    schema.createEEnumLiteral(accessMethodEnum, "WEB_INTERFACE");
    schema.createEEnumLiteral(accessMethodEnum, "INTERNAL");
    schema.createEEnumLiteral(accessMethodEnum, "REST");
    schema.createEEnumLiteral(accessMethodEnum, "SYNDICATION");
    schema.createEEnumLiteral(accessMethodEnum, "JSON");
    EClass logAction = schema.createEClass(logPackage, "LogAction");
    schema.createEAttribute(logAction, "date", EcorePackage.eINSTANCE.getEDate(), Multiplicity.SINGLE);
    schema.createEReference(logAction, "executor", user, Multiplicity.SINGLE);
    schema.createEAttribute(logAction, "accessMethod", accessMethodEnum, Multiplicity.SINGLE);
    EClass serverLogClass = schema.createEClass(logPackage, "ServerLog");
    schema.createEReference(serverLogClass, "actions", logAction, Multiplicity.MANY);
    EClass projectRelated = schema.createEClass(logPackage, "ProjectRelated", logAction);
    EReference projectRelatedProject = schema.createEReference(projectRelated, "project", project, Multiplicity.SINGLE);
    EClass checkoutRelated = schema.createEClass(logPackage, "CheckoutRelated", logAction);
    EReference checkoutRelatedCheckout = schema.createEReference(checkoutRelated, "checkout", checkoutClass, Multiplicity.SINGLE);
    EClass revisionRelated = schema.createEClass(logPackage, "RevisionRelated", logAction);
    EReference revisionRelatedRevision = schema.createEReference(revisionRelated, "revision", revisionClass, Multiplicity.SINGLE);
    EClass userRelated = schema.createEClass(logPackage, "UserRelated", logAction);
    EReference userRelatedUser = schema.createEReference(userRelated, "user", user, Multiplicity.SINGLE);
    schema.createEClass(logPackage, "NewUserAdded", userRelated);
    EClass newProjectAddedClass = schema.createEClass(logPackage, "NewProjectAdded", projectRelated);
    schema.createEReference(newProjectAddedClass, "parentProject", project, Multiplicity.SINGLE);
    EClass revisionBrancedClass = schema.createEClass(logPackage, "RevisionBranched", logAction);
    schema.createEReference(revisionBrancedClass, "oldrevision", revisionClass, Multiplicity.SINGLE);
    schema.createEReference(revisionBrancedClass, "newrevision", revisionClass, Multiplicity.SINGLE);
    EClass newRevisionAdded = schema.createEClass(logPackage, "NewRevisionAdded", revisionRelated);
    schema.createEReference(newRevisionAdded, "project", project, Multiplicity.SINGLE);
    schema.createEClass(logPackage, "NewCheckoutAdded", checkoutRelated);
    schema.createEClass(logPackage, "SettingsSaved", logAction);
    // and actually also projectRelated
    EClass userAddedToProject = schema.createEClass(logPackage, "UserAddedToProject", userRelated);
    schema.createEReference(userAddedToProject, "project", project, Multiplicity.SINGLE);
    schema.createEClass(logPackage, "NewObjectIDMUploaded", logAction);
    schema.createEClass(logPackage, "Download", logAction);
    // and actually also projectRelated
    EClass userRemovedFromProject = schema.createEClass(logPackage, "UserRemovedFromProject", userRelated);
    schema.createEReference(userRemovedFromProject, "project", project, Multiplicity.SINGLE);
    schema.createEClass(logPackage, "ProjectDeleted", projectRelated);
    schema.createEClass(logPackage, "UserDeleted", userRelated);
    schema.createEClass(logPackage, "PasswordReset", userRelated);
    EClass databaseCreatedClass = schema.createEClass(logPackage, "DatabaseCreated", logAction);
    schema.createEAttribute(databaseCreatedClass, "path", ecorePackage.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(databaseCreatedClass, "version", ecorePackage.getEIntegerObject(), Multiplicity.SINGLE);
    schema.createEClass(logPackage, "ServerStarted", logAction);
    schema.createEClass(logPackage, "ProjectUpdated", projectRelated);
    schema.createEClass(logPackage, "UserUndeleted", userRelated);
    schema.createEClass(logPackage, "ProjectUndeleted", projectRelated);
    schema.createEClass(logPackage, "RevisionUpdated", revisionRelated);
    EClass geoTagUpdatedClass = schema.createEClass(logPackage, "GeoTagUpdated", logAction);
    schema.createEReference(geoTagUpdatedClass, "geoTag", geoTagClass, Multiplicity.SINGLE);
    schema.createEClass(logPackage, "PasswordChanged", userRelated);
    schema.createEClass(logPackage, "UserChanged", userRelated);
    EClass pluginConfiguration = schema.createEClass(storePackage, "PluginConfiguration");
    schema.createEAttribute(pluginConfiguration, "name", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(pluginConfiguration, "enabled", EcorePackage.eINSTANCE.getEBooleanObject(), Multiplicity.SINGLE);
    schema.createEAttribute(pluginConfiguration, "description", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    EClass serializerPluginConfiguration = schema.createEClass(storePackage, "SerializerPluginConfiguration", pluginConfiguration);
    EClass objectIDMPluginConfiguration = schema.createEClass(storePackage, "ObjectIDMPluginConfiguration", pluginConfiguration);
    EReference serializerObjectIDMReference = schema.createEReference(serializerPluginConfiguration, "objectIDM", objectIDMPluginConfiguration, Multiplicity.SINGLE);
    EReference serializerSettingsReference = schema.createEReference(serializerPluginConfiguration, "userSettings", userSettings, Multiplicity.SINGLE);
    EReference objectIDMSerializers = schema.createEReference(objectIDMPluginConfiguration, "serializers", serializerPluginConfiguration, Multiplicity.MANY);
    EReference objectIDMSettingsReference = schema.createEReference(objectIDMPluginConfiguration, "userSettings", userSettings, Multiplicity.SINGLE);
    EReference settingsSerializersReference = schema.createEReference(userSettings, "serializers", serializerPluginConfiguration, Multiplicity.MANY);
    EReference settingsObjectIDMReference = schema.createEReference(userSettings, "objectIDMs", objectIDMPluginConfiguration, Multiplicity.MANY);
    serializerSettingsReference.setEOpposite(settingsSerializersReference);
    objectIDMSettingsReference.setEOpposite(settingsObjectIDMReference);
    settingsSerializersReference.setEOpposite(serializerSettingsReference);
    settingsObjectIDMReference.setEOpposite(objectIDMSettingsReference);
    objectIDMSerializers.setEOpposite(serializerObjectIDMReference);
    serializerObjectIDMReference.setEOpposite(objectIDMSerializers);
    schema.createEAttribute(serverSettings, "cacheOutputFiles", EcorePackage.eINSTANCE.getEBooleanObject(), Multiplicity.SINGLE);
    EClass renderEnginePluginConfiguration = schema.createEClass(storePackage, "RenderEnginePluginConfiguration", pluginConfiguration);
    EReference renderEngineSerializersReference = schema.createEReference(renderEnginePluginConfiguration, "serializers", serializerPluginConfiguration, Multiplicity.MANY);
    EReference serializerRenderEngineReference = schema.createEReference(serializerPluginConfiguration, "renderEngine", renderEnginePluginConfiguration, Multiplicity.SINGLE);
    serializerRenderEngineReference.setEOpposite(renderEngineSerializersReference);
    renderEngineSerializersReference.setEOpposite(serializerRenderEngineReference);
    EReference renderEngineSettings = schema.createEReference(renderEnginePluginConfiguration, "userSettings", userSettings, Multiplicity.SINGLE);
    EReference settingsRenderEngines = schema.createEReference(userSettings, "renderEngines", renderEnginePluginConfiguration, Multiplicity.MANY);
    settingsRenderEngines.setEOpposite(renderEngineSettings);
    renderEngineSettings.setEOpposite(settingsRenderEngines);
    EClass deserializerPluginClass = schema.createEClass(storePackage, "DeserializerPluginConfiguration", pluginConfiguration);
    EReference deserializerSettingsReference = schema.createEReference(deserializerPluginClass, "userSettings", userSettings, Multiplicity.SINGLE);
    EReference settingsDeserializersReference = schema.createEReference(userSettings, "deserializers", deserializerPluginClass, Multiplicity.MANY);
    deserializerSettingsReference.setEOpposite(settingsDeserializersReference);
    settingsDeserializersReference.setEOpposite(deserializerSettingsReference);
    EDataType dataHandler = schema.createEDataType(storePackage, EcoreFactory.eINSTANCE.createEDataType());
    dataHandler.setName("DataHandler");
    dataHandler.setInstanceClass(DataHandler.class);
    EClass downloadResultClass = schema.createEClass(storePackage, "DownloadResult");
    schema.createEAttribute(downloadResultClass, "projectName", ecorePackage.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(downloadResultClass, "revisionNr", ecorePackage.getEIntegerObject(), Multiplicity.SINGLE);
    schema.createEAttribute(downloadResultClass, "file", dataHandler, Multiplicity.SINGLE);
    schema.createEClass(storePackage, "CheckoutResult", downloadResultClass);
    EClass dataValue = schema.createEClass(storePackage, "DataValue");
    schema.createEAttribute(dataValue, "fieldName", ecorePackage.getEString(), Multiplicity.SINGLE);
    EClass dataObjectClass = schema.createEClass(storePackage, "DataObject");
    schema.createEAttribute(dataObjectClass, "type", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(dataObjectClass, "guid", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(dataObjectClass, "name", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEReference(dataObjectClass, "values", dataValue, Multiplicity.MANY).getEAnnotations().add(createEmbedsReferenceAnnotation());
    EClass userSessionClass = schema.createEClass(storePackage, "UserSession");
    schema.createEReference(userSessionClass, "user", user, Multiplicity.SINGLE);
    schema.createEAttribute(userSessionClass, "username", ecorePackage.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(userSessionClass, "name", ecorePackage.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(userSessionClass, "type", schema.getEEnum("store", "UserType"), Multiplicity.SINGLE);
    schema.createEAttribute(userSessionClass, "remoteAddress", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(userSessionClass, "activeSince", ecorePackage.getEDate(), Multiplicity.SINGLE);
    schema.createEAttribute(userSessionClass, "lastActive", ecorePackage.getEDate(), Multiplicity.SINGLE);
    schema.createEAttribute(userSessionClass, "accessMethod", schema.getEEnum("log", "AccessMethod"), Multiplicity.SINGLE);
    EClass migrationClass = schema.createEClass(storePackage, "Migration");
    schema.createEAttribute(migrationClass, "number", ecorePackage.getEIntegerObject(), Multiplicity.SINGLE);
    schema.createEAttribute(migrationClass, "description", ecorePackage.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(migrationClass, "executed", ecorePackage.getEBooleanObject(), Multiplicity.SINGLE);
    EClass referenceDataValue = schema.createEClass(storePackage, "ReferenceDataValue", dataValue);
    schema.createEAttribute(referenceDataValue, "typeName", ecorePackage.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(referenceDataValue, "guid", ecorePackage.getEString(), Multiplicity.SINGLE);
    EClass listDataValue = schema.createEClass(storePackage, "ListDataValue", dataValue);
    schema.createEReference(listDataValue, "values", dataValue, Multiplicity.MANY).getEAnnotations().add(createEmbedsReferenceAnnotation());
    EClass simpleDataValue = schema.createEClass(storePackage, "SimpleDataValue", dataValue);
    schema.createEAttribute(simpleDataValue, "stringValue", ecorePackage.getEString(), Multiplicity.SINGLE);
    EClass databaseInformationItem = schema.createEClass(storePackage, "DatabaseInformationItem");
    schema.createEAttribute(databaseInformationItem, "key", ecorePackage.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(databaseInformationItem, "value", ecorePackage.getEString(), Multiplicity.SINGLE);
    EClass databaseInformationCategoryClass = schema.createEClass(storePackage, "DatabaseInformationCategory");
    schema.createEAttribute(databaseInformationCategoryClass, "title", ecorePackage.getEString(), Multiplicity.SINGLE);
    schema.createEReference(databaseInformationCategoryClass, "items", databaseInformationItem, Multiplicity.MANY).getEAnnotations().add(createEmbedsReferenceAnnotation());
    EClass databaseInformationClass = schema.createEClass(storePackage, "DatabaseInformation");
    schema.createEAttribute(databaseInformationClass, "numberOfProjects", ecorePackage.getEIntegerObject(), Multiplicity.SINGLE);
    schema.createEAttribute(databaseInformationClass, "numberOfUsers", ecorePackage.getEIntegerObject(), Multiplicity.SINGLE);
    schema.createEAttribute(databaseInformationClass, "numberOfRevisions", ecorePackage.getEIntegerObject(), Multiplicity.SINGLE);
    schema.createEAttribute(databaseInformationClass, "numberOfCheckouts", ecorePackage.getEIntegerObject(), Multiplicity.SINGLE);
    schema.createEAttribute(databaseInformationClass, "databaseSizeInBytes", ecorePackage.getELongObject(), Multiplicity.SINGLE);
    schema.createEAttribute(databaseInformationClass, "type", ecorePackage.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(databaseInformationClass, "created", ecorePackage.getEDate(), Multiplicity.SINGLE);
    schema.createEAttribute(databaseInformationClass, "location", ecorePackage.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(databaseInformationClass, "schemaVersion", ecorePackage.getEIntegerObject(), Multiplicity.SINGLE);
    schema.createEReference(databaseInformationClass, "categories", databaseInformationCategoryClass, Multiplicity.MANY).getEAnnotations().add(createEmbedsReferenceAnnotation());
    EClass pluginDescriptor = schema.createEClass(storePackage, "PluginDescriptor");
    schema.createEAttribute(pluginDescriptor, "name", ecorePackage.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(pluginDescriptor, "pluginClassName", ecorePackage.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(pluginDescriptor, "description", ecorePackage.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(pluginDescriptor, "location", ecorePackage.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(pluginDescriptor, "enabled", ecorePackage.getEBooleanObject(), Multiplicity.SINGLE);
    schema.createEAttribute(pluginDescriptor, "pluginInterfaceClassName", ecorePackage.getEString(), Multiplicity.SINGLE);
    EReference pluginConfigurationPluginDescriptor = schema.createEReference(pluginConfiguration, "pluginDescriptor", pluginDescriptor, Multiplicity.SINGLE);
    EReference pluginDescriptorPluginConfiguration = schema.createEReference(pluginDescriptor, "configurations", pluginConfiguration, Multiplicity.MANY);
    pluginDescriptorPluginConfiguration.setEOpposite(pluginConfigurationPluginDescriptor);
    pluginConfigurationPluginDescriptor.setEOpposite(pluginDescriptorPluginConfiguration);
    EClass revisionSummaryTypeClass = schema.createEClass(storePackage, "RevisionSummaryType");
    schema.createEAttribute(revisionSummaryTypeClass, "name", ecorePackage.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(revisionSummaryTypeClass, "count", ecorePackage.getEIntegerObject(), Multiplicity.SINGLE);
    EClass revisionSummaryContainerClass = schema.createEClass(storePackage, "RevisionSummaryContainer");
    schema.createEAttribute(revisionSummaryContainerClass, "name", ecorePackage.getEString(), Multiplicity.SINGLE);
    schema.createEReference(revisionSummaryContainerClass, "types", revisionSummaryTypeClass, Multiplicity.MANY).getEAnnotations().add(createEmbedsReferenceAnnotation());
    EClass revisionSummaryClass = schema.createEClass(storePackage, "RevisionSummary");
    schema.createEReference(revisionSummaryClass, "list", revisionSummaryContainerClass, Multiplicity.MANY).getEAnnotations().add(createEmbedsReferenceAnnotation());
    schema.createEReference(concreteRevisionClass, "summary", revisionSummaryClass, Multiplicity.SINGLE);
    EClass longActionClass = schema.createEClass(storePackage, "LongAction");
    schema.createEAttribute(longActionClass, "identification", ecorePackage.getEString(), Multiplicity.SINGLE);
    schema.createEReference(longActionClass, "user", user, Multiplicity.SINGLE);
    schema.createEAttribute(longActionClass, "start", ecorePackage.getEDate(), Multiplicity.SINGLE);
    schema.createEAttribute(longActionClass, "username", ecorePackage.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(longActionClass, "name", ecorePackage.getEString(), Multiplicity.SINGLE);
    EClass objectIDMPluginDescriptor = schema.createEClass(storePackage, "ObjectIDMPluginDescriptor");
    schema.createEAttribute(objectIDMPluginDescriptor, "className", ecorePackage.getEString(), Multiplicity.SINGLE);
    EEnum compareTypeEnum = schema.createEEnum(storePackage, "CompareType");
    schema.createEEnumLiteral(compareTypeEnum, "ALL");
    schema.createEEnumLiteral(compareTypeEnum, "ADD");
    schema.createEEnumLiteral(compareTypeEnum, "MODIFY");
    schema.createEEnumLiteral(compareTypeEnum, "DELETE");
    EClass compareItemClass = schema.createEClass(storePackage, "CompareItem");
    schema.createEReference(compareItemClass, "dataObject", dataObjectClass, Multiplicity.SINGLE).getEAnnotations().add(createEmbedsReferenceAnnotation());
    schema.createEClass(storePackage, "ObjectAdded", compareItemClass);
    schema.createEClass(storePackage, "ObjectRemoved", compareItemClass);
    EClass objectModified = schema.createEClass(storePackage, "ObjectModified", compareItemClass);
    schema.createEAttribute(objectModified, "fieldName", ecorePackage.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(objectModified, "oldValue", ecorePackage.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(objectModified, "newValue", ecorePackage.getEString(), Multiplicity.SINGLE);
    EClass compareContainerClass = schema.createEClass(storePackage, "CompareContainer");
    schema.createEAttribute(compareContainerClass, "type", ecorePackage.getEString(), Multiplicity.SINGLE);
    schema.createEReference(compareContainerClass, "items", compareItemClass, Multiplicity.MANY).getEAnnotations().add(createEmbedsReferenceAnnotation());
    EClass compareResultClass = schema.createEClass(storePackage, "CompareResult");
    schema.createEReference(compareResultClass, "items", compareContainerClass, Multiplicity.MANY).getEAnnotations().add(createEmbedsReferenceAnnotation());
    EEnum actionStateEnum = schema.createEEnum(storePackage, "ActionState");
    schema.createEEnumLiteral(actionStateEnum, "UNKNOWN");
    schema.createEEnumLiteral(actionStateEnum, "STARTED");
    schema.createEEnumLiteral(actionStateEnum, "AS_ERROR");
    schema.createEEnumLiteral(actionStateEnum, "FINISHED");
    EClass longActionStateClass = schema.createEClass(storePackage, "LongActionState");
    schema.createEAttribute(longActionStateClass, "start", ecorePackage.getEDate(), Multiplicity.SINGLE);
    schema.createEAttribute(longActionStateClass, "end", ecorePackage.getEDate(), Multiplicity.SINGLE);
    schema.createEAttribute(longActionStateClass, "progress", ecorePackage.getEIntegerObject(), Multiplicity.SINGLE);
    schema.createEAttribute(longActionStateClass, "state", actionStateEnum, Multiplicity.SINGLE);
    schema.createEAttribute(longActionStateClass, "title", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(longActionStateClass, "stage", EcorePackage.eINSTANCE.getEInt(), Multiplicity.SINGLE);
    schema.createEAttribute(longActionStateClass, "errors", EcorePackage.eINSTANCE.getEString(), Multiplicity.MANY);
    schema.createEAttribute(longActionStateClass, "warnings", EcorePackage.eINSTANCE.getEString(), Multiplicity.MANY);
    schema.createEAttribute(longActionStateClass, "infos", EcorePackage.eINSTANCE.getEString(), Multiplicity.MANY);
    schema.createEEnumLiteral(accessMethodEnum, "PROTOCOL_BUFFERS");
    EEnum serverState = schema.createEEnum(storePackage, "ServerState");
    schema.createEEnumLiteral(serverState, "UNDEFINED");
    schema.createEEnumLiteral(serverState, "NOT_SETUP");
    schema.createEEnumLiteral(serverState, "SETUP");
    schema.createEEnumLiteral(serverState, "MIGRATION_REQUIRED");
    schema.createEEnumLiteral(serverState, "MIGRATION_IMPOSSIBLE");
    schema.createEEnumLiteral(serverState, "FATAL_ERROR");
    schema.createEEnumLiteral(serverState, "RUNNING");
    EClass serverInfoClass = schema.createEClass(storePackage, "ServerInfo");
    schema.createEAttribute(serverInfoClass, "serverState", serverState, Multiplicity.SINGLE);
    schema.createEAttribute(serverInfoClass, "errorMessage", ecorePackage.getEString(), Multiplicity.SINGLE);
    EClass versionInfoClass = schema.createEClass(storePackage, "Version");
    schema.createEAttribute(versionInfoClass, "major", ecorePackage.getEIntegerObject(), Multiplicity.SINGLE);
    schema.createEAttribute(versionInfoClass, "minor", ecorePackage.getEIntegerObject(), Multiplicity.SINGLE);
    schema.createEAttribute(versionInfoClass, "revision", ecorePackage.getEIntegerObject(), Multiplicity.SINGLE);
    schema.createEAttribute(versionInfoClass, "fullString", ecorePackage.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(versionInfoClass, "date", ecorePackage.getEDate(), Multiplicity.SINGLE);
    schema.createEAttribute(versionInfoClass, "downloadUrl", ecorePackage.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(versionInfoClass, "supportUrl", ecorePackage.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(versionInfoClass, "supportEmail", ecorePackage.getEString(), Multiplicity.SINGLE);
    schema.createEReference(concreteRevisionClass, "user", user, Multiplicity.SINGLE);
    EClass file = schema.createEClass("store", "File");
    schema.createEAttribute(file, "data", EcorePackage.eINSTANCE.getEByteArray(), Multiplicity.SINGLE);
    schema.createEAttribute(file, "filename", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(file, "mime", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(file, "size", EcorePackage.eINSTANCE.getELong(), Multiplicity.SINGLE);
    EClass extendedDataSchema = schema.createEClass(storePackage, "ExtendedDataSchema");
    schema.createEAttribute(extendedDataSchema, "name", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(extendedDataSchema, "url", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(extendedDataSchema, "contentType", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(extendedDataSchema, "description", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEReference(extendedDataSchema, "file", file, Multiplicity.SINGLE);
    schema.createEAttribute(extendedDataSchema, "size", EcorePackage.eINSTANCE.getELong(), Multiplicity.SINGLE);
    EClass extendedDataClass = schema.createEClass(storePackage, "ExtendedData");
    schema.createEAttribute(extendedDataClass, "url", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEReference(extendedDataClass, "file", file, Multiplicity.SINGLE);
    schema.createEAttribute(extendedDataClass, "size", EcorePackage.eINSTANCE.getELong(), Multiplicity.SINGLE);
    schema.createEAttribute(extendedDataClass, "title", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(extendedDataClass, "added", EcorePackage.eINSTANCE.getEDate(), Multiplicity.SINGLE);
    EReference userToExtendedDataSchema = schema.createEReference(user, "schemas", extendedDataSchema, Multiplicity.MANY);
    EReference extendedDataSchemaToUser = schema.createEReference(extendedDataSchema, "users", user, Multiplicity.MANY);
    userToExtendedDataSchema.setEOpposite(extendedDataSchemaToUser);
    extendedDataSchemaToUser.setEOpposite(userToExtendedDataSchema);
    EReference extendedDataToUser = schema.createEReference(extendedDataClass, "user", user, Multiplicity.SINGLE);
    EReference userToExtendedData = schema.createEReference(user, "extendedData", extendedDataClass, Multiplicity.MANY);
    extendedDataToUser.setEOpposite(userToExtendedData);
    userToExtendedData.setEOpposite(extendedDataToUser);
    EReference extendedDataToExtendedDataSchema = schema.createEReference(extendedDataClass, "schema", extendedDataSchema, Multiplicity.SINGLE);
    EReference extendedDataSchemaToExtendedData = schema.createEReference(extendedDataSchema, "extendedData", extendedDataClass, Multiplicity.MANY);
    extendedDataToExtendedDataSchema.setEOpposite(extendedDataSchemaToExtendedData);
    extendedDataSchemaToExtendedData.setEOpposite(extendedDataToExtendedDataSchema);
    EReference revisionExtendedData = schema.createEReference(revisionClass, "extendedData", extendedDataClass, Multiplicity.MANY);
    EReference extendedDataRevision = schema.createEReference(extendedDataClass, "revision", revisionClass, Multiplicity.SINGLE);
    revisionExtendedData.setEOpposite(extendedDataRevision);
    extendedDataRevision.setEOpposite(revisionExtendedData);
    EReference projectExtendedData = schema.createEReference(project, "extendedData", extendedDataClass, Multiplicity.MANY);
    EReference extendedDataProject = schema.createEReference(extendedDataClass, "project", project, Multiplicity.SINGLE);
    projectExtendedData.setEOpposite(extendedDataProject);
    extendedDataProject.setEOpposite(projectExtendedData);
    EClass queryEnginePluginConfiguration = schema.createEClass(storePackage, "QueryEnginePluginConfiguration", pluginConfiguration);
    EReference queryEngineSettingsReference = schema.createEReference(queryEnginePluginConfiguration, "userSettings", userSettings, Multiplicity.SINGLE);
    EReference settingsQueryEnginesReference = schema.createEReference(userSettings, "queryEngines", queryEnginePluginConfiguration, Multiplicity.MANY);
    queryEngineSettingsReference.setEOpposite(settingsQueryEnginesReference);
    settingsQueryEnginesReference.setEOpposite(queryEngineSettingsReference);
    EClass webModulePluginConfiguration = schema.createEClass(storePackage, "WebModulePluginConfiguration", pluginConfiguration);
    EReference webModulePluginSettingsReference = schema.createEReference(webModulePluginConfiguration, "serverSettings", serverSettings, Multiplicity.SINGLE);
    EReference settingsWebReference = schema.createEReference(serverSettings, "webModules", webModulePluginConfiguration, Multiplicity.MANY);
    webModulePluginSettingsReference.setEOpposite(settingsWebReference);
    settingsWebReference.setEOpposite(webModulePluginSettingsReference);
    EClass modelMergerPluginConfiguration = schema.createEClass(storePackage, "ModelMergerPluginConfiguration", pluginConfiguration);
    EReference modelMergerSettingsReference = schema.createEReference(modelMergerPluginConfiguration, "userSettings", userSettings, Multiplicity.SINGLE);
    EReference settingsModelMergersReference = schema.createEReference(userSettings, "modelMergers", modelMergerPluginConfiguration, Multiplicity.MANY);
    modelMergerSettingsReference.setEOpposite(settingsModelMergersReference);
    settingsModelMergersReference.setEOpposite(modelMergerSettingsReference);
    EClass modelComparePluginConfiguration = schema.createEClass(storePackage, "ModelComparePluginConfiguration", pluginConfiguration);
    EReference modelCompareSettingsReference = schema.createEReference(modelComparePluginConfiguration, "userSettings", userSettings, Multiplicity.SINGLE);
    EReference settingsModelComparesReference = schema.createEReference(userSettings, "modelCompares", modelComparePluginConfiguration, Multiplicity.MANY);
    modelCompareSettingsReference.setEOpposite(settingsModelComparesReference);
    settingsModelComparesReference.setEOpposite(modelCompareSettingsReference);
    schema.createEReference(userSettings, "defaultModelMerger", modelMergerPluginConfiguration, Multiplicity.SINGLE);
    schema.createEReference(userSettings, "defaultModelCompare", modelComparePluginConfiguration, Multiplicity.SINGLE);
    schema.createEReference(userSettings, "defaultQueryEngine", queryEnginePluginConfiguration, Multiplicity.SINGLE);
    schema.createEReference(userSettings, "defaultRenderEngine", renderEnginePluginConfiguration, Multiplicity.SINGLE);
    schema.createEReference(userSettings, "defaultSerializer", serializerPluginConfiguration, Multiplicity.SINGLE);
    schema.createEReference(userSettings, "defaultObjectIDM", objectIDMPluginConfiguration, Multiplicity.SINGLE);
    schema.createEReference(serverSettings, "webModule", webModulePluginConfiguration, Multiplicity.SINGLE);
    EEnum trigger = schema.createEEnum("store", "Trigger");
    schema.createEEnumLiteral(trigger, "NEW_REVISION");
    schema.createEEnumLiteral(trigger, "NEW_PROJECT");
    schema.createEEnumLiteral(trigger, "NEW_EXTENDED_DATA");
    EClass profileDescriptor = schema.createEClass(storePackage, "ProfileDescriptor");
    profileDescriptor.getEAnnotations().add(createNoDatabaseAnnotation());
    schema.createEAttribute(profileDescriptor, "name", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(profileDescriptor, "description", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(profileDescriptor, "publicProfile", EcorePackage.eINSTANCE.getEBoolean(), Multiplicity.SINGLE);
    schema.createEAttribute(profileDescriptor, "identifier", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    EClass serviceDescriptor = schema.createEClass(storePackage, "ServiceDescriptor");
    serviceDescriptor.getEAnnotations().add(createNoDatabaseAnnotation());
    schema.createEAttribute(serviceDescriptor, "name", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(serviceDescriptor, "url", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(serviceDescriptor, "token", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(serviceDescriptor, "identifier", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(serviceDescriptor, "notificationProtocol", schema.getEEnum("log", "AccessMethod"), Multiplicity.SINGLE);
    schema.createEAttribute(serviceDescriptor, "description", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(serviceDescriptor, "trigger", trigger, Multiplicity.SINGLE);
    schema.createEAttribute(serviceDescriptor, "readRevision", EcorePackage.eINSTANCE.getEBoolean(), Multiplicity.SINGLE);
    schema.createEAttribute(serviceDescriptor, "readExtendedData", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(serviceDescriptor, "writeRevision", EcorePackage.eINSTANCE.getEBoolean(), Multiplicity.SINGLE);
    schema.createEAttribute(serviceDescriptor, "writeExtendedData", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(serviceDescriptor, "providerName", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    EClass service = schema.createEClass("store", "Service");
    schema.createEAttribute(service, "name", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(service, "serviceName", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(service, "serviceIdentifier", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(service, "providerName", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(service, "url", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(service, "token", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(service, "notificationProtocol", schema.getEEnum("log", "AccessMethod"), Multiplicity.SINGLE);
    schema.createEAttribute(service, "description", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(service, "trigger", trigger, Multiplicity.SINGLE);
    schema.createEAttribute(service, "readRevision", EcorePackage.eINSTANCE.getEBoolean(), Multiplicity.SINGLE);
    schema.createEReference(service, "readExtendedData", extendedDataSchema, Multiplicity.SINGLE);
    schema.createEReference(service, "writeRevision", project, Multiplicity.SINGLE);
    schema.createEReference(service, "writeExtendedData", extendedDataSchema, Multiplicity.SINGLE);
    schema.createEAttribute(service, "profileIdentifier", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(service, "profileName", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(service, "profileDescription", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(service, "profilePublic", EcorePackage.eINSTANCE.getEBoolean(), Multiplicity.SINGLE);
    EReference serviceProject = schema.createEReference(service, "project", project, Multiplicity.SINGLE);
    EReference projectServices = schema.createEReference(project, "services", service, Multiplicity.MANY);
    serviceProject.setEOpposite(projectServices);
    projectServices.setEOpposite(serviceProject);
    EReference serviceUser = schema.createEReference(service, "user", user, Multiplicity.SINGLE);
    EReference userServices = schema.createEReference(user, "services", service, Multiplicity.MANY);
    serviceUser.setEOpposite(userServices);
    userServices.setEOpposite(serviceUser);
    schema.createEAttribute(serverSettings, "serviceRepositoryUrl", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    EClass tokenClass = schema.createEClass("store", "Token");
    schema.createEAttribute(tokenClass, "tokenString", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(tokenClass, "expires", EcorePackage.eINSTANCE.getELong(), Multiplicity.SINGLE);
    EClass internalServicePluginConfiguration = schema.createEClass(storePackage, "InternalServicePluginConfiguration", pluginConfiguration);
    schema.createEAttribute(internalServicePluginConfiguration, "remoteAccessible", EcorePackage.eINSTANCE.getEBoolean(), Multiplicity.SINGLE);
    schema.createEReference(service, "internalService", internalServicePluginConfiguration, Multiplicity.SINGLE);
    EReference serviceSettingsReference = schema.createEReference(internalServicePluginConfiguration, "userSettings", userSettings, Multiplicity.SINGLE);
    EReference settingsServicesReference = schema.createEReference(userSettings, "services", internalServicePluginConfiguration, Multiplicity.MANY);
    serviceSettingsReference.setEOpposite(settingsServicesReference);
    settingsServicesReference.setEOpposite(serviceSettingsReference);
    EClass serviceInterface = schema.createEClass("store", "ServiceInterface");
    serviceInterface.getEAnnotations().add(createNoDatabaseAnnotation());
    schema.createEAttribute(serviceInterface, "name", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(serviceInterface, "nameSpace", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(serviceInterface, "simpleName", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    EClass serviceMethod = schema.createEClass("store", "ServiceMethod");
    serviceMethod.getEAnnotations().add(createNoDatabaseAnnotation());
    schema.createEAttribute(serviceMethod, "name", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(serviceMethod, "doc", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(serviceMethod, "returnDoc", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    EEnum serviceSimpleType = schema.createEEnum("store", "ServiceSimpleType");
    schema.createEEnumLiteral(serviceSimpleType, "ENUM");
    schema.createEEnumLiteral(serviceSimpleType, "STRING");
    schema.createEEnumLiteral(serviceSimpleType, "LONG");
    schema.createEEnumLiteral(serviceSimpleType, "INT");
    schema.createEEnumLiteral(serviceSimpleType, "BOOLEAN");
    schema.createEEnumLiteral(serviceSimpleType, "FLOAT");
    schema.createEEnumLiteral(serviceSimpleType, "DOUBLE");
    schema.createEEnumLiteral(serviceSimpleType, "DATE");
    schema.createEEnumLiteral(serviceSimpleType, "CLASS");
    schema.createEEnumLiteral(serviceSimpleType, "DATAHANDLER");
    schema.createEEnumLiteral(serviceSimpleType, "BYTEARRAY");
    schema.createEEnumLiteral(serviceSimpleType, "LIST");
    schema.createEEnumLiteral(serviceSimpleType, "SET");
    schema.createEEnumLiteral(serviceSimpleType, "VOID");
    schema.createEEnumLiteral(serviceSimpleType, "UNKNOWN");
    EClass serviceField = schema.createEClass("store", "ServiceField");
    serviceField.getEAnnotations().add(createNoDatabaseAnnotation());
    EClass serviceType = schema.createEClass("store", "ServiceType");
    schema.createEAttribute(serviceField, "name", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEReference(serviceField, "type", serviceType, Multiplicity.SINGLE).getEAnnotations().add(createEmbedsReferenceAnnotation());
    schema.createEReference(serviceField, "genericType", serviceType, Multiplicity.SINGLE).getEAnnotations().add(createEmbedsReferenceAnnotation());
    schema.createEAttribute(serviceField, "doc", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(serviceType, "name", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(serviceType, "simpleName", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEReference(serviceType, "fields", serviceField, Multiplicity.MANY).getEAnnotations().add(createEmbedsReferenceAnnotation());
    schema.createEAttribute(serviceType, "simpleType", serviceSimpleType, Multiplicity.SINGLE).getEAnnotations();
    EClass serviceParameter = schema.createEClass("store", "ServiceParameter");
    serviceParameter.getEAnnotations().add(createNoDatabaseAnnotation());
    schema.createEAttribute(serviceParameter, "name", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(serviceParameter, "doc", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEReference(serviceParameter, "type", serviceType, Multiplicity.SINGLE).getEAnnotations().add(createEmbedsReferenceAnnotation());
    schema.createEReference(serviceParameter, "genericType", serviceType, Multiplicity.SINGLE).getEAnnotations().add(createEmbedsReferenceAnnotation());
    EClass extendedDataAddedToRevision = schema.createEClass(logPackage, "ExtendedDataAddedToRevision", logAction);
    schema.createEReference(extendedDataAddedToRevision, "revision", revisionClass, Multiplicity.SINGLE);
    schema.createEReference(extendedDataAddedToRevision, "extendedData", extendedDataClass, Multiplicity.SINGLE);
    EClass extendedDataAddedToProject = schema.createEClass(logPackage, "ExtendedDataAddedToProject", logAction);
    schema.createEReference(extendedDataAddedToProject, "project", project, Multiplicity.SINGLE);
    schema.createEReference(extendedDataAddedToProject, "extendedData", extendedDataClass, Multiplicity.SINGLE);
    EEnum primitiveEnum = schema.createEEnum("store", "PrimitiveEnum");
    schema.createEEnumLiteral(primitiveEnum, "LONG");
    schema.createEEnumLiteral(primitiveEnum, "DOUBLE");
    schema.createEEnumLiteral(primitiveEnum, "BOOLEAN");
    schema.createEEnumLiteral(primitiveEnum, "STRING");
    schema.createEEnumLiteral(primitiveEnum, "BYTE_ARRAY");
    EClass typeDefinition = schema.createEClass("store", "TypeDefinition");
    typeDefinition.getEAnnotations().add(createNoDatabaseAnnotation());
    EClass objectDefinition = schema.createEClass("store", "ObjectDefinition", typeDefinition);
    objectDefinition.getEAnnotations().add(createNoDatabaseAnnotation());
    EClass primitiveDefinition = schema.createEClass("store", "PrimitiveDefinition", typeDefinition);
    primitiveDefinition.getEAnnotations().add(createNoDatabaseAnnotation());
    EClass arrayDefinition = schema.createEClass("store", "ArrayDefinition", typeDefinition);
    arrayDefinition.getEAnnotations().add(createNoDatabaseAnnotation());
    EClass parameterDefinition = schema.createEClass("store", "ParameterDefinition");
    parameterDefinition.getEAnnotations().add(createNoDatabaseAnnotation());
    schema.createEAttribute(parameterDefinition, "name", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(parameterDefinition, "identifier", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(parameterDefinition, "required", EcorePackage.eINSTANCE.getEBoolean(), Multiplicity.SINGLE);
    schema.createEAttribute(parameterDefinition, "description", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEReference(parameterDefinition, "type", typeDefinition, Multiplicity.SINGLE).getEAnnotations().add(createEmbedsReferenceAnnotation());
    schema.createEReference(objectDefinition, "parameters", parameterDefinition, Multiplicity.MANY).getEAnnotations().add(createEmbedsReferenceAnnotation());
    schema.createEAttribute(primitiveDefinition, "type", primitiveEnum, Multiplicity.SINGLE);
    schema.createEReference(arrayDefinition, "type", typeDefinition, Multiplicity.SINGLE).getEAnnotations().add(createEmbedsReferenceAnnotation());
    EClass type = schema.createEClass("store", "Type");
    EClass objectType = schema.createEClass("store", "ObjectType", type);
    EClass primitiveType = schema.createEClass("store", "PrimitiveType", type);
    EClass longType = schema.createEClass("store", "LongType", primitiveType);
    EClass byteArrayType = schema.createEClass("store", "ByteArrayType", primitiveType);
    EClass doubleType = schema.createEClass("store", "DoubleType", primitiveType);
    EClass stringType = schema.createEClass("store", "StringType", primitiveType);
    EClass booleanType = schema.createEClass("store", "BooleanType", primitiveType);
    EClass arrayType = schema.createEClass("store", "ArrayType", type);
    EClass parameter = schema.createEClass("store", "Parameter");
    schema.createEAttribute(objectType, "name", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEReference(objectType, "parameters", parameter, Multiplicity.MANY).getEAnnotations().add(createEmbedsReferenceAnnotation());
    schema.createEAttribute(parameter, "identifier", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(parameter, "name", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEReference(parameter, "value", type, Multiplicity.SINGLE).getEAnnotations().add(createEmbedsReferenceAnnotation());
    schema.createEReference(parameterDefinition, "defaultValue", type, Multiplicity.SINGLE).getEAnnotations().add(createEmbedsReferenceAnnotation());
    schema.createEReference(arrayType, "values", type, Multiplicity.MANY).getEAnnotations().add(createEmbedsReferenceAnnotation());
    schema.createEAttribute(longType, "value", EcorePackage.eINSTANCE.getELong(), Multiplicity.SINGLE);
    schema.createEAttribute(doubleType, "value", EcorePackage.eINSTANCE.getEDouble(), Multiplicity.SINGLE);
    schema.createEAttribute(byteArrayType, "value", EcorePackage.eINSTANCE.getEByteArray(), Multiplicity.SINGLE);
    schema.createEAttribute(stringType, "value", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    schema.createEAttribute(booleanType, "value", EcorePackage.eINSTANCE.getEBoolean(), Multiplicity.SINGLE);
    schema.createEReference(pluginConfiguration, "settings", objectType, Multiplicity.SINGLE);
    EEnum notificationResultEnum = schema.createEEnum("store", "NotifictionResultEnum");
    schema.createEEnumLiteral(notificationResultEnum, "NR_ERROR");
    schema.createEEnumLiteral(notificationResultEnum, "SUCCESS");
    schema.createEEnumLiteral(notificationResultEnum, "PROGRESS_UNKNOWN");
    schema.createEEnumLiteral(notificationResultEnum, "PROGRESS_PERCENTAGE");
    EClass immediateNotificationResult = schema.createEClass("store", "ImmediateNotificationResult");
    schema.createEAttribute(immediateNotificationResult, "result", notificationResultEnum, Multiplicity.SINGLE);
    schema.createEAttribute(immediateNotificationResult, "description", EcorePackage.eINSTANCE.getEString(), Multiplicity.SINGLE);
    EClass remoteServiceCalled = schema.createEClass("log", "RemoteServiceCalled", logAction);
    schema.createEReference(remoteServiceCalled, "service", service, Multiplicity.SINGLE);
    schema.createEAttribute(remoteServiceCalled, "state", notificationResultEnum, Multiplicity.SINGLE);
    schema.createEAttribute(remoteServiceCalled, "percentage", EcorePackage.eINSTANCE.getEInt(), Multiplicity.SINGLE);
    schema.createEAttribute(remoteServiceCalled, "infos", EcorePackage.eINSTANCE.getEString(), Multiplicity.MANY);
    schema.createEAttribute(remoteServiceCalled, "warnings", EcorePackage.eINSTANCE.getEString(), Multiplicity.MANY);
    schema.createEAttribute(remoteServiceCalled, "errors", EcorePackage.eINSTANCE.getEString(), Multiplicity.MANY);
    EReference projectLogs = schema.createEReference(project, "logs", projectRelated, Multiplicity.MANY);
    EReference revisionLogs = schema.createEReference(revisionClass, "logs", revisionRelated, Multiplicity.MANY);
    EReference userLogs = schema.createEReference(user, "logs", userRelated, Multiplicity.MANY);
    EReference checkoutLogs = schema.createEReference(checkoutClass, "logs", checkoutRelated, Multiplicity.MANY);
    projectRelatedProject.setEOpposite(projectLogs);
    projectLogs.setEOpposite(projectRelatedProject);
    revisionRelatedRevision.setEOpposite(revisionLogs);
    revisionLogs.setEOpposite(revisionRelatedRevision);
    userRelatedUser.setEOpposite(userLogs);
    userLogs.setEOpposite(userRelatedUser);
    checkoutRelatedCheckout.setEOpposite(checkoutLogs);
    checkoutLogs.setEOpposite(checkoutRelatedCheckout);
    EClass remoteServiceUpdate = schema.createEClass("store", "RemoteServiceUpdate");
    EClass percentageChange = schema.createEClass("store", "PercentageChange", remoteServiceUpdate);
    schema.createEAttribute(percentageChange, "percentage", EcorePackage.eINSTANCE.getEInt(), Multiplicity.SINGLE);
    EClass systemInfo = schema.createEClass("store", "SystemInfo");
    schema.createEAttribute(systemInfo, "cpucores", EcorePackage.eINSTANCE.getEInt());
    schema.createEAttribute(systemInfo, "datetime", EcorePackage.eINSTANCE.getEDate());
    schema.createEAttribute(systemInfo, "osname", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(systemInfo, "osversion", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(systemInfo, "userName", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(systemInfo, "userHome", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(systemInfo, "userDir", EcorePackage.eINSTANCE.getEString());
    EClass javaInfo = schema.createEClass("store", "JavaInfo");
    schema.createEAttribute(javaInfo, "heapTotal", EcorePackage.eINSTANCE.getELong());
    schema.createEAttribute(javaInfo, "heapUsed", EcorePackage.eINSTANCE.getELong());
    schema.createEAttribute(javaInfo, "heapFree", EcorePackage.eINSTANCE.getELong());
    schema.createEAttribute(javaInfo, "heapMax", EcorePackage.eINSTANCE.getELong());
    schema.createEAttribute(javaInfo, "threads", EcorePackage.eINSTANCE.getEInt());
    schema.createEAttribute(javaInfo, "javaHome", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(javaInfo, "javaVersion", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(javaInfo, "javaVendor", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(javaInfo, "javaVendorurl", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(javaInfo, "javavmVersion", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(javaInfo, "javavmVendor", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(javaInfo, "javavmName", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(javaInfo, "javaspecVersion", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(javaInfo, "javaspecVendor", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(javaInfo, "javaspecName", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(javaInfo, "javaClassVersion", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(javaInfo, "javaClasspath", EcorePackage.eINSTANCE.getEString(), Multiplicity.MANY);
    schema.createEAttribute(javaInfo, "javaLibrarypath", EcorePackage.eINSTANCE.getEString(), Multiplicity.MANY);
    schema.createEAttribute(javaInfo, "javaIoTmp", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(javaInfo, "javaExtdir", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(javaInfo, "javaFileSeparator", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(javaInfo, "javaPathSeparator", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(javaInfo, "javaLineSeparator", EcorePackage.eINSTANCE.getEString());
    EClass bimserverInfo = schema.createEClass("store", "BimServerInfo");
    schema.createEAttribute(bimserverInfo, "currentVersion", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(bimserverInfo, "currentDate", EcorePackage.eINSTANCE.getEDate());
    schema.createEAttribute(bimserverInfo, "schemaVersion", EcorePackage.eINSTANCE.getEInt());
    schema.createEAttribute(bimserverInfo, "latestDate", EcorePackage.eINSTANCE.getEDate());
    schema.createEAttribute(bimserverInfo, "latestVersion", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(bimserverInfo, "projects", EcorePackage.eINSTANCE.getEInt());
    schema.createEAttribute(bimserverInfo, "revisions", EcorePackage.eINSTANCE.getEInt());
    schema.createEAttribute(bimserverInfo, "users", EcorePackage.eINSTANCE.getEInt());
    schema.createEAttribute(bimserverInfo, "checkouts", EcorePackage.eINSTANCE.getEInt());
    schema.createEAttribute(bimserverInfo, "serverLogUrl", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(bimserverInfo, "started", EcorePackage.eINSTANCE.getEDate());
    EEnum progressTopicType = schema.createEEnum("store", "ProgressTopicType");
    schema.createEEnumLiteral(progressTopicType, "DOWNLOAD");
    schema.createEEnumLiteral(progressTopicType, "UPLOAD");
    schema.createEEnumLiteral(progressTopicType, "RUNNING_SERVICE");
    schema.createEEnumLiteral(progressTopicType, "BRANCH");
    schema.createEReference(revisionClass, "service", service, Multiplicity.SINGLE);
    EClass projectSmall = schema.createEClass("store", "ProjectSmall");
    schema.createEAttribute(projectSmall, "name", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(projectSmall, "parentId", EcorePackage.eINSTANCE.getELong());
    EClass ifcHeader = schema.createEClass("store", "IfcHeader");
    schema.createEAttribute(ifcHeader, "description", EcorePackage.eINSTANCE.getEString(), Multiplicity.MANY).setUnique(false);
    schema.createEAttribute(ifcHeader, "implementationLevel", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(ifcHeader, "filename", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(ifcHeader, "timeStamp", EcorePackage.eINSTANCE.getEDate());
    schema.createEAttribute(ifcHeader, "author", EcorePackage.eINSTANCE.getEString(), Multiplicity.MANY).setUnique(false);
    schema.createEAttribute(ifcHeader, "organization", EcorePackage.eINSTANCE.getEString(), Multiplicity.MANY).setUnique(false);
    schema.createEAttribute(ifcHeader, "preProcessorVersion", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(ifcHeader, "originatingSystem", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(ifcHeader, "ifcSchemaVersion", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(ifcHeader, "authorization", EcorePackage.eINSTANCE.getEString());
    schema.createEReference(concreteRevisionClass, "ifcHeader", ifcHeader, Multiplicity.SINGLE);
}
Also used : EClass(org.eclipse.emf.ecore.EClass) EDataType(org.eclipse.emf.ecore.EDataType) EEnum(org.eclipse.emf.ecore.EEnum) EReference(org.eclipse.emf.ecore.EReference) EPackage(org.eclipse.emf.ecore.EPackage)

Example 29 with EReference

use of org.eclipse.emf.ecore.EReference in project BIMserver by opensourceBIM.

the class Step0014 method migrate.

@Override
public void migrate(Schema schema, DatabaseSession databaseSession) {
    schema.createEClass(schema.getEPackage("store"), "MessagingSerializerPluginConfiguration", schema.getEClass("store", "SerializerPluginConfiguration"));
    schema.getEClass("store", "UserSettings");
    EClass serverSettings = schema.getEClass("store", "ServerSettings");
    schema.createEAttribute(serverSettings, "allowCreateValidatedUser", EcorePackage.eINSTANCE.getEBoolean());
    EClass version = schema.getEClass("store", "Version");
    EClass serverInfo = schema.getEClass("store", "ServerInfo");
    EReference versionReference = schema.createEReference(serverInfo, "version", version, Multiplicity.SINGLE);
    versionReference.getEAnnotations().add(createEmbedsReferenceAnnotation());
}
Also used : EClass(org.eclipse.emf.ecore.EClass) EReference(org.eclipse.emf.ecore.EReference)

Example 30 with EReference

use of org.eclipse.emf.ecore.EReference in project BIMserver by opensourceBIM.

the class Step0025 method migrate.

@Override
public void migrate(Schema schema, DatabaseSession databaseSession) {
    EClass newServiceDescriptor = schema.createEClass("store", "NewServiceDescriptor");
    schema.createEAttribute(newServiceDescriptor, "name", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(newServiceDescriptor, "description", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(newServiceDescriptor, "provider", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(newServiceDescriptor, "authorizationUrl", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(newServiceDescriptor, "tokenUrl", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(newServiceDescriptor, "resourceUrl", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(newServiceDescriptor, "registerUrl", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(newServiceDescriptor, "inputs", EcorePackage.eINSTANCE.getEString(), Multiplicity.MANY);
    schema.createEAttribute(newServiceDescriptor, "outputs", EcorePackage.eINSTANCE.getEString(), Multiplicity.MANY);
    EClass formatSerializerMap = schema.createEClass("store", "FormatSerializerMap");
    schema.createEAttribute(formatSerializerMap, "format", EcorePackage.eINSTANCE.getEString());
    schema.createEReference(formatSerializerMap, "serializers", schema.getEClass("store", "SerializerPluginConfiguration"), Multiplicity.MANY).getEAnnotations().add(createEmbedsReferenceAnnotation());
    EClass actionClass = schema.createEClass("store", "Action");
    schema.createEClass("store", "StoreExtendedData", actionClass);
    EClass checkinRevisionClass = schema.createEClass("store", "CheckinRevision", actionClass);
    EClass projectClass = schema.getEClass("store", "Project");
    schema.createEReference(checkinRevisionClass, "project", projectClass);
    EEnum serviceStatus = schema.createEEnum("store", "ServiceStatus");
    schema.createEEnumLiteral(serviceStatus, "NEW");
    schema.createEEnumLiteral(serviceStatus, "AUTHENTICATED");
    EClass newServiceClass = schema.createEClass("store", "NewService");
    schema.createEAttribute(newServiceClass, "name", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(newServiceClass, "provider", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(newServiceClass, "description", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(newServiceClass, "authorizationUrl", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(newServiceClass, "tokenUrl", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(newServiceClass, "resourceUrl", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(newServiceClass, "registerUrl", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(newServiceClass, "input", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(newServiceClass, "oauthCode", EcorePackage.eINSTANCE.getEString());
    schema.createEAttribute(newServiceClass, "status", serviceStatus);
    schema.createEReference(newServiceClass, "serializer", schema.getEClass("store", "SerializerPluginConfiguration"));
    schema.createEAttribute(newServiceClass, "output", EcorePackage.eINSTANCE.getEString());
    EReference actionReference = schema.createEReference(newServiceClass, "action", actionClass);
    actionReference.getEAnnotations().add(createEmbedsReferenceAnnotation());
    schema.createEAttribute(newServiceClass, "accessToken", EcorePackage.eINSTANCE.getEString());
    schema.createEReference(newServiceClass, "project", projectClass);
    schema.createEReference(projectClass, "newServices", newServiceClass, Multiplicity.MANY);
    schema.createEReference(schema.getEClass("store", "Revision"), "servicesLinked", newServiceClass, Multiplicity.MANY);
}
Also used : EClass(org.eclipse.emf.ecore.EClass) EEnum(org.eclipse.emf.ecore.EEnum) EReference(org.eclipse.emf.ecore.EReference)

Aggregations

EReference (org.eclipse.emf.ecore.EReference)229 EObject (org.eclipse.emf.ecore.EObject)118 EClass (org.eclipse.emf.ecore.EClass)58 List (java.util.List)52 ArrayList (java.util.ArrayList)48 EStructuralFeature (org.eclipse.emf.ecore.EStructuralFeature)37 Test (org.junit.Test)31 EAttribute (org.eclipse.emf.ecore.EAttribute)29 PalladioSelectEObjectDialog (org.palladiosimulator.editors.commons.dialogs.selection.PalladioSelectEObjectDialog)28 EClassifier (org.eclipse.emf.ecore.EClassifier)21 Resource (org.eclipse.emf.ecore.resource.Resource)21 IdEObject (org.bimserver.emf.IdEObject)18 EList (org.eclipse.emf.common.util.EList)17 IScope (org.eclipse.xtext.scoping.IScope)15 HashMapVirtualObject (org.bimserver.shared.HashMapVirtualObject)14 InternalEObject (org.eclipse.emf.ecore.InternalEObject)14 URI (org.eclipse.emf.common.util.URI)13 EPackage (org.eclipse.emf.ecore.EPackage)12 AbstractEList (org.eclipse.emf.common.util.AbstractEList)10 CrossReference (org.eclipse.xtext.CrossReference)10