コード例 #1
0
        public PropertyExpression([NotNull] IProperty property)
            : base(Check.NotNull(property, "property").PropertyType)
        {
            Check.NotNull(property, "property");

            PropertyName = property.ColumnName();
        }
コード例 #2
0
        public ColumnModification(
            [NotNull] StateEntry stateEntry,
            [NotNull] IProperty property,
            [NotNull] ParameterNameGenerator parameterNameGenerator,
            bool isRead,
            bool isWrite,
            bool isKey,
            bool isCondition)
        {
            Check.NotNull(stateEntry, "stateEntry");
            Check.NotNull(property, "property");
            Check.NotNull(parameterNameGenerator, "parameterNameGenerator");

            _stateEntry    = stateEntry;
            _property      = property;
            _columnName    = property.ColumnName();
            _parameterName = isWrite
                ? new LazyRef <string>(parameterNameGenerator.GenerateNext)
                : new LazyRef <string>((string)null);
            _originalParameterName = isCondition
                ? new LazyRef <string>(parameterNameGenerator.GenerateNext)
                : new LazyRef <string>((string)null);
            _outputParameterName = isRead
                ? new LazyRef <string>(parameterNameGenerator.GenerateNext)
                : new LazyRef <string>((string)null);
            _isRead      = isRead;
            _isWrite     = isWrite;
            _isKey       = isKey;
            _isCondition = isCondition;
        }
コード例 #3
0
        public override string ToString()
        {
            var s = _tableAlias + "." + _property.ColumnName();

            if (Alias != null)
            {
                s += " " + Alias;
            }

            return(s);
        }
コード例 #4
0
        private static Column BuildColumn(Table table, IProperty property)
        {
            var column =
                new Column(property.ColumnName(), property.PropertyType, property.ColumnType())
            {
                IsNullable              = property.IsNullable,
                DefaultValue            = property.ColumnDefaultValue(),
                DefaultSql              = property.ColumnDefaultSql(),
                ValueGenerationStrategy = property.ValueGenerationOnSave,
                IsTimestamp             = property.PropertyType == typeof(byte[]) && property.IsConcurrencyToken
            };

            table.AddColumn(column);

            return(column);
        }
コード例 #5
0
        public ColumnModification(
            [NotNull] StateEntry stateEntry,
            [NotNull] IProperty property,
            [CanBeNull] string parameterName,
            [CanBeNull] string originalParameterName,
            bool isRead,
            bool isWrite,
            bool isKey,
            bool isCondition)
        {
            Check.NotNull(stateEntry, "stateEntry");
            Check.NotNull(property, "property");

            _stateEntry            = stateEntry;
            _property              = property;
            _columnName            = property.ColumnName();
            _parameterName         = parameterName;
            _originalParameterName = originalParameterName;
            _isRead      = isRead;
            _isWrite     = isWrite;
            _isKey       = isKey;
            _isCondition = isCondition;
        }
コード例 #6
0
        private static Column BuildColumn(Table table, IProperty property)
        {
            var column =
                new Column(property.ColumnName(), property.PropertyType, property.ColumnType())
                    {
                        IsNullable = property.IsNullable,
                        DefaultValue = property.ColumnDefaultValue(),
                        DefaultSql = property.ColumnDefaultSql(),
                        ValueGenerationStrategy = property.ValueGenerationOnSave,
                        IsTimestamp = property.PropertyType == typeof(byte[]) && property.IsConcurrencyToken
                    };

            table.AddColumn(column);

            return column;
        }