Search in sources :

Example 1 with NewAttributeChange

use of org.bimserver.database.migrations.change.NewAttributeChange in project BIMserver by opensourceBIM.

the class Schema method createEAttribute.

public EAttribute createEAttribute(EClass eClass, String name, EDataType eDataType, Multiplicity multiplicity) {
    EAttribute eAttribute = EcoreFactory.eINSTANCE.createEAttribute();
    eAttribute.setName(name);
    if (multiplicity == Multiplicity.MANY) {
        eAttribute.setUpperBound(-1);
    }
    if (!isNew(eClass)) {
        changes.add(new NewAttributeChange(this, eClass.getEAllStructuralFeatures().size(), eAttribute));
    }
    eAttribute.setEType(eDataType);
    eClass.getEStructuralFeatures().add(eAttribute);
    return eAttribute;
}
Also used : EAttribute(org.eclipse.emf.ecore.EAttribute) NewAttributeChange(org.bimserver.database.migrations.change.NewAttributeChange)

Aggregations

NewAttributeChange (org.bimserver.database.migrations.change.NewAttributeChange)1 EAttribute (org.eclipse.emf.ecore.EAttribute)1