internal Relation(Model owner, string schema, string entityName, string name, bool navigate, string schema2, string entityName2, string name2, bool navigate2, bool required, Cardinality cardinality, Persistence persistence) : base(owner, name) { this.schema = schema; this.entityName = entityName; this.navigate = navigate; this.schema2 = schema2; this.entityName2 = entityName2; this.name2 = name2; this.navigate2 = navigate2; this.required = required; this.cardinality = cardinality; Init(); this.persistence = new Persistence(this, persistence); this.attrMatch = new RelationAttributesMatch(this); this.foreignKey = Model.PhysicalModel.ForeignKeys.CreateForeignKey(this); }
public Relation(Model owner, XmlNode node) : base(owner, node) { QualName name = new QualName(node, "schema", "entity", Model.DefaultSchema); this.schema = name.Schema; this.entityName = name.Name; QualName name2 = new QualName(node, "schema2", "entity2", Model.DefaultSchema); this.schema2 = name2.Schema; this.entityName2 = name2.Name; this.name2 = Utils.Xml.GetAttrValue(node, "name2", Const.EmptyName); this.required = Utils.Xml.GetAttrValue(node, "required", this.required); this.navigate = Utils.Xml.GetAttrValue(node, "navigate", this.navigate); this.navigate2 = Utils.Xml.GetAttrValue(node, "navigate2", this.navigate2); this.cardinality = ParseCardinality(Utils.Xml.GetAttrValue(node, "cardinality")); this.cascade = ParseRelationCascade(Utils.Xml.GetAttrValue(node, "cascade")); Init(); this.persistence = new Persistence(this, node); this.attrMatch = new RelationAttributesMatch(this, node); this.foreignKey = Model.PhysicalModel.ForeignKeys.CreateForeignKey(this); this.hasIndexName = Utils.Xml.IsAttrExists(node, "indexName"); this.indexName = Utils.Xml.GetAttrValue(node, "indexName", this.indexName); }