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;
}
Aggregations