@Override public void migrate(Schema schema, DatabaseSession databaseSession) { EAttribute projectUuid = schema.createEAttribute(schema.getEClass("store", "Project"), "uuid", EcorePackage.eINSTANCE.getEString()); projectUuid.getEAnnotations().add(createUniqueAnnotation()); schema.addIndex(projectUuid); EAttribute userUuid = schema.createEAttribute(schema.getEClass("store", "User"), "uuid", EcorePackage.eINSTANCE.getEString()); userUuid.getEAnnotations().add(createUniqueAnnotation()); schema.addIndex(userUuid); // Disabled for revisions for now, caused weird error // EAttribute revisionUuid = schema.createEAttribute(schema.getEClass("store", "Revision"), "uuid", EcorePackage.eINSTANCE.getEString()); // revisionUuid.getEAnnotations().add(createUniqueAnnotation()); // schema.addIndex(revisionUuid); }
doubleStringAttribute.setEType(ePackage.getEString()); doubleStringAttribute.setName("wrappedValueAsString"); doubleStringAttribute.getEAnnotations().add(createAsStringAnnotation()); doubleStringAttribute.getEAnnotations().add(createHiddenAnnotation()); doubleStringAttribute.setUnsettable(true); testType.getEStructuralFeatures().add(doubleStringAttribute);
EAttribute doubleStringAttribute = eFactory.createEAttribute(); doubleStringAttribute.setName(attributeName.getName() + "AsString"); doubleStringAttribute.getEAnnotations().add(createAsStringAnnotation()); doubleStringAttribute.getEAnnotations().add(createHiddenAnnotation()); doubleStringAttribute.setUnsettable(true); // TODO
EAttribute doubleStringAttribute = eFactory.createEAttribute(); doubleStringAttribute.setName(attrib.getName() + "AsString"); doubleStringAttribute.getEAnnotations().add(createAsStringAnnotation()); doubleStringAttribute.getEAnnotations().add(createHiddenAnnotation()); doubleStringAttribute.setEType(EcorePackage.eINSTANCE.getEString()); doubleStringAttribute.setUnsettable(expAttrib.isOptional()); EAttribute doubleStringAttribute = eFactory.createEAttribute(); doubleStringAttribute.setName(attrib.getName() + "AsString"); doubleStringAttribute.getEAnnotations().add(createAsStringAnnotation()); doubleStringAttribute.getEAnnotations().add(createHiddenAnnotation()); doubleStringAttribute.setEType(EcorePackage.eINSTANCE.getEString()); doubleStringAttribute.setUpperBound(-1); doubleStringAttribute.getEAnnotations().add(createHiddenAnnotation()); doubleStringAttribute.getEAnnotations().add(createAsStringAnnotation()); doubleStringAttribute.setName(attrib.getName() + "AsString"); doubleStringAttribute.setUpperBound(-1); doubleStringAttribute.getEAnnotations().add(createHiddenAnnotation()); doubleStringAttribute.getEAnnotations().add(createAsStringAnnotation()); doubleStringAttribute.setName(attrib.getName() + "AsString"); doubleStringAttribute.setUpperBound(-1); cls.getEStructuralFeatures().add(eAttribute); EAttribute eAttributeAsString = eFactory.createEAttribute(); eAttributeAsString.getEAnnotations().add(createAsStringAnnotation()); eAttributeAsString.getEAnnotations().add(createHiddenAnnotation()); eAttributeAsString.setUnsettable(expAttrib.isOptional());
private void createUserClass() { schema.createEAttribute(user, "name", ecorePackage.getEString(), Multiplicity.SINGLE); schema.createEAttribute(user, "passwordHash", ecorePackage.getEByteArray(), Multiplicity.SINGLE); schema.createEAttribute(user, "passwordSalt", ecorePackage.getEByteArray(), Multiplicity.SINGLE); userHasRightsOn = schema.createEReference(user, "hasRightsOn", project, Multiplicity.MANY); schema.createEAttribute(user, "state", objectStateEnum, Multiplicity.SINGLE); schema.createEAttribute(user, "createdOn", ecorePackage.getEDate(), Multiplicity.SINGLE); schema.createEReference(user, "createdBy", user, Multiplicity.SINGLE); schema.createEAttribute(user, "userType", userTypeEnum, Multiplicity.SINGLE); schema.createEAttribute(user, "username", ecorePackage.getEString(), Multiplicity.SINGLE).getEAnnotations().add(createUniqueAnnotation()); schema.createEAttribute(user, "lastSeen", ecorePackage.getEDate(), Multiplicity.SINGLE); schema.createEAttribute(user, "token", ecorePackage.getEString(), Multiplicity.SINGLE); schema.createEAttribute(user, "validationToken", ecorePackage.getEByteArray(), Multiplicity.SINGLE); schema.createEAttribute(user, "validationTokenCreated", ecorePackage.getEDate(), Multiplicity.SINGLE); schema.createEReference(user, "userSettings", userSettings, 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();