Exemple #1
0
        public TableMapping(Type type)
        {
            MappedType = type;

            TableName            = OrmHelper.GetTableName(MappedType);
            OldTableName         = OrmHelper.GetOldTableName(MappedType);
            OnPrimaryKeyConflict = OrmHelper.GetOnPrimaryKeyConflict(MappedType);
            _properties          = OrmHelper.GetProperties(this.MappedType);
            Columns     = _properties.Select(x => new Column(x)).ToList();
            Checks      = OrmHelper.GetChecks(this.MappedType);
            ForeignKeys = OrmHelper.GetForeignKeys(_properties);
            Indexes     = OrmHelper.GetIndexes(MappedType, _properties);

            Virtual   = OrmHelper.GetVirtual(MappedType);
            Tokenizer = OrmHelper.GetTokenizer(MappedType);
        }
Exemple #2
0
        public TableMapping(Type type)
        {
            this.MappedType = type;

            this.TableName            = OrmHelper.GetTableName(this.MappedType);
            this.OldTableName         = OrmHelper.GetOldTableName(this.MappedType);
            this.OnPrimaryKeyConflict = OrmHelper.GetOnPrimaryKeyConflict(this.MappedType);
            this._properties          = OrmHelper.GetProperties(this.MappedType);
            this.Columns     = this._properties.Select(x => new Column(x)).ToList();
            this.Checks      = OrmHelper.GetChecks(this.MappedType);
            this.ForeignKeys = OrmHelper.GetForeignKeys(this._properties);
            this.Indexes     = OrmHelper.GetIndexes(this.MappedType, this._properties);

            this.Virtual   = OrmHelper.GetVirtual(this.MappedType);
            this.Tokenizer = OrmHelper.GetTokenizer(this.MappedType);
        }
Exemple #3
0
            internal Column(PropertyInfo prop)
            {
                _prop = prop;
                this._dataConverter = null;

                Name = OrmHelper.GetColumnName(prop);
                // If this type is Nullable<T> then Nullable.GetUnderlyingType returns the T,
                // otherwise it returns null, so get the the actual type instead
                ColumnType                  = OrmHelper.GetColumnType(prop);
                Collation                   = OrmHelper.GetCollation(prop);
                PrimaryKey                  = OrmHelper.GetPrimaryKey(prop);
                IsNullable                  = this.PrimaryKey == null && OrmHelper.GetIsColumnNullable(prop);
                IsAutoIncrement             = OrmHelper.GetIsAutoIncrement(prop);
                Unique                      = OrmHelper.GetUnique(prop);
                MaxStringLength             = OrmHelper.GetMaxStringLength(prop);
                Checks                      = OrmHelper.GetChecks(prop);
                DefaultValue                = OrmHelper.GetDefaultValue(prop);
                this.DataConverterAttribute = OrmHelper.GetDataConverter(prop);
            }