예제 #1
0
        private IPlanItem CreateLastestByIdPlanItem(IColumnMetadata column)
        {
            var rowScan = new RowScanPlanItem(_journal, _tx);

            rowScan.ApplyLastestByIdPlanItem(column);
            return(rowScan);
        }
예제 #2
0
        public void IndexCollectionScan <TT>(string memberName, TT[] values)
        {
            var p = new RowScanPlanItem(_journal, _tx);

            p.AddContainsScan(Metadata.GetColumnByPropertyName(memberName), values);
            _planHead = p;
        }
예제 #3
0
        public void ColumnLambdaScan <T>(IColumnMetadata column, Func <T, bool> lambda)
        {
            var planItem = new RowScanPlanItem(_journal, _tx);

            planItem.AddLambdaScan(column, lambda);
            _planHead = planItem;
        }
예제 #4
0
        public void ColumnScan <T>(IColumnMetadata column, T literal)
        {
            var planItem = new RowScanPlanItem(_journal, _tx);

            planItem.AddContainsScan(column, literal);
            _planHead = planItem;
        }
예제 #5
0
        public void ColumnNotNullScan(IColumnMetadata column)
        {
            var planItem = new RowScanPlanItem(_journal, _tx);

            _planHead = planItem;

            if (!Metadata.IsNullColumnID.HasValue || !column.Nullable || column.NullIndex < 0)
            {
                return;
            }

            var isNullColumn = Metadata.GetColumnByID(Metadata.IsNullColumnID.Value);
            Func <ByteArray, bool> lambda = ba => !ba.IsSet(column.NullIndex);

            planItem.AddLambdaScan(isNullColumn, lambda);
        }
예제 #6
0
        public void IndexCollectionScan(string memberName, IEnumerable values, Expression exp)
        {
            var p      = new RowScanPlanItem(_journal, _tx);
            var column = Metadata.GetColumnByPropertyName(memberName);

            switch (column.DataType.ColumnType)
            {
            case EFieldType.Byte:
                p.AddContainsScan(column, ToIList <byte>(values));
                break;

            case EFieldType.Bool:
                p.AddContainsScan(column, ToIList <bool>(values));
                break;

            case EFieldType.Int16:
                p.AddContainsScan(column, ToIList <short>(values));
                break;

            case EFieldType.Int32:
                p.AddContainsScan(column, ToIList <int>(values));
                break;

            case EFieldType.Int64:
                p.AddContainsScan(column, ToIList <long>(values));
                break;

            case EFieldType.Double:
                p.AddContainsScan(column, ToIList <double>(values));
                break;

            case EFieldType.Symbol:
            case EFieldType.String:
                p.AddContainsScan(column, ToIList <string>(values));
                break;

            case EFieldType.DateTime:
            case EFieldType.DateTimeEpochMs:
                p.AddContainsScan(column, ToIList <DateTime>(values));
                break;

            default:
                throw QueryExceptionExtensions.ExpressionNotSupported(
                          string.Format("Column of type {0} cannot be bound to Contains expressions", column.DataType.ColumnType), exp);
            }
            _planHead = p;
        }