Beispiel #1
0
 public Constraint(Reflected.Field thisField, Reflected.Field otherField, Table table)
 {
     this._thisField = thisField;
     this._otherField = otherField;
     this._table = table;
 }
Beispiel #2
0
 public Field(System.Reflection.PropertyInfo property, System.Data.Linq.Mapping.ColumnAttribute attribute, Table table, SpecificationEnum specification)
 {
     build(property, attribute, table, specification);
 }
Beispiel #3
0
 public DummyConstraint(string thisName, string otherName, Table table)
 {
     this._thisName = thisName;
     this._otherName = otherName;
     this._table = table;
 }
Beispiel #4
0
        private void build(System.Reflection.PropertyInfo property, System.Data.Linq.Mapping.ColumnAttribute attribute, Table table, SpecificationEnum specification)
        {
            this._key = (attribute.Name != null ? attribute.Name : attribute.Storage.Substring(1)).Trim();

            if (this._key == property.Name)
            {
                throw new Gale.Exception.GaleException("API008",property.Name);
            }

            this._name = char.ToLower(property.Name[0]) + property.Name.Substring(1);
            this._type = property.PropertyType;
            this._table = table;
            this._specification = specification;
            this._selected = false;

            if (attribute.IsPrimaryKey)
            {
                _specification = SpecificationEnum.Pk;
                table.SetPrimaryKey(this);

                if (attribute.IsPrimaryKey && table.IsForeign == false)
                {
                    this._selected = true;
                }
            }
        }