public override void Validate(RootElement root) { base.Validate(root); SqlEntityElement foreignEntity = root.FindSqlEntity(this.foreignEntity.Name); if (foreignEntity == null) { root.AddValidationMessage(ParserValidationMessage.NewError(String.Format("Foreign entity ({0}) not found for constraint ({1}).", this.foreignEntity.Name, this.Name))); } else { this.foreignEntity = foreignEntity; ArrayList columns = new ArrayList(); foreach (ColumnElement column in foreignColumns) { ColumnElement columnElement = this.foreignEntity.FindColumnByName(column.Name); if (columnElement == null) { root.AddValidationMessage(ParserValidationMessage.NewError(String.Format("Foreign column ({0}) not found for constraint ({1}).", column.Name, this.Name))); } else { columns.Add(columnElement); } } this.foreignColumns = columns; } }
public override void Validate(RootElement root) { // Find the sql entity. SqlEntityElement sqlEntity = root.FindSqlEntity(this.sqlEntity.Name); if (sqlEntity == null) { root.AddValidationMessage(ParserValidationMessage.NewError(String.Format("Sql Entity ({0}) not found.", this.sqlEntity.Name))); } else { this.sqlEntity = sqlEntity; // Validate each of the column map entries. foreach (ColumnMapElement columnMap in this.columnMaps) { columnMap.Validate(root); } } }