public EntityConstraint(Entity owner, XmlNode constraintNode) : base(owner, constraintNode) { persistence = new Persistence(this, constraintNode); attributes = new EntityConstraintAttributes(this); AddAttributes(Model.QueryNode(constraintNode, "./{0}:OnAttribute")); AddAttributes(Model.QueryNode(constraintNode, "./{0}:Attribute")); if (this.Attributes.Count == 0) { throw new GlException("Constraint definition is incomplete: no attributes found. {0}. Constraint: {1}. {2}", Name, GetType().Name, Entity); } }
public EntityConstraint(Entity entity, string name) : base(entity, name) { persistence = new Persistence(this, entity.Persistence.Persisted, entity.Persistence.SchemaDefined, entity.Persistence.Schema, false, name, false, Const.EmptyName ); attributes = new EntityConstraintAttributes(this); }