public override void save() { if (this._wrappedOperation == null) { this._wrappedOperation = this._factory._modelFactory.createNewElement <Operation>(this._owner._wrappedClass, this._name); this._wrappedOperation.setStereotype(getStereotype()); } if (this._wrappedOperation != null) { this._wrappedOperation.save(); this.isOverridden = this.isOverridden; //get the corresponding columns from this table this.involvedColumns = this.ownerTable.columns.Where(x => _involvedColumns.Any(y => y.name == x.name)).ToList(); if (this._wrappedOperation != null) { //first remove all existing parameters this._wrappedOperation.ownedParameters = new HashSet <UML.Classes.Kernel.Parameter>(); foreach (var column in _involvedColumns) { { ParameterWrapper parameter = this._wrappedOperation.model.factory.createNewElement <Parameter>(this._wrappedOperation, column.name) as ParameterWrapper; parameter.type = ((Column)column)._wrappedattribute.type; //TODO: this would be nicer if we could keep the parameters in memory and not save them directly parameter.save(); } } } } }
public override void save() { if (this._wrappedOperation == null) { this._wrappedOperation = this._factory._modelFactory.createNewElement <Operation>(this._owner._wrappedClass, this._name); this._wrappedOperation.setStereotype(getStereotype()); } if (this._wrappedOperation != null) { this._wrappedOperation.save(); this.isOverridden = this.isOverridden; this.isRenamed = this.isRenamed; //get the corresponding columns from this table this.involvedColumns = getCorrespondingColumns(); if (this._wrappedOperation != null) { //first remove all existing parameters this._wrappedOperation.ownedParameters = new HashSet <UML.Classes.Kernel.Parameter>(); uint parameterPosition = 0; foreach (var column in _involvedColumns) { { ParameterWrapper parameter = this._wrappedOperation.model.factory.createNewElement <Parameter>(this._wrappedOperation, column.name) as ParameterWrapper; parameter.type = ((Column)column)._wrappedattribute.type; parameter.position = parameterPosition; //TODO: this would be nicer if we could keep the parameters in memory and not save them directly parameter.save(); parameterPosition++; } } } } //set all attributes to static foreach (Column involvedColumn in this.involvedColumns) { if (involvedColumn._wrappedattribute != null && !involvedColumn._wrappedattribute.isStatic) { involvedColumn._wrappedattribute.isStatic = true; involvedColumn._wrappedattribute.save(); } } }