Examples of typeClass()


Examples of com.foundationdb.server.types.TInstance.typeClass()

            }
            ValueSource expectedField = expected.value(expectedPosition);
            ValueSource actualField = actual.value(actualPosition);
            TInstance expectedType = expected.rowType().typeAt(expectedPosition);
            TInstance actualType = actual.rowType().typeAt(actualPosition);
            assertEquals("expected type", expectedType.typeClass(), actualType.typeClass());
            int c = TClass.compare(expectedType, expectedField, actualType, actualField);
            if (c != 0)
                return false;
        }
        return true;
View Full Code Here

Examples of com.foundationdb.server.types.TInstance.typeClass()

            }
            TValidatedScalar overload = registry.getScalarsResolver().get(functionName, input).getOverload();
            TInstance functionType = overload.resultStrategy().fixed(column.getNullable());
            TPreparedExpression expr = new TPreparedFunction(overload, functionType, arguments);
            if (!functionType.equals(columnType)) {
                TCast tcast = registry.getCastsResolver().cast(functionType.typeClass(), columnType.typeClass());
                expr = new TCastExpression(expr, tcast, columnType);
            }
            TEvaluatableExpression eval = expr.build();
            eval.with(queryContext);
            expressions[fi] = eval;
View Full Code Here

Examples of com.foundationdb.server.types.TInstance.typeClass()

        if (sourceType == null) {
            sourceType = targetType;
        }
        ValueSource source = ValueSources.valuefromObject(value, sourceType);
        if (targetType != null)
            source = cachedCast(index, source, sourceType, targetType.typeClass());
        setValue(index, source);
    }

    public boolean wasNull() {
        return wasNull;
View Full Code Here

Examples of com.foundationdb.server.types.TInstance.typeClass()

            encoder.appendString((i == 0) ? "\"" : ",\"");
            Quote.DOUBLE_QUOTE.append(appender, resultColumn.getName());
            encoder.appendString("\":");
            ValueSource value = row.value(i);
            TInstance columnTInstance = resultColumn.getType();
            if (columnTInstance.typeClass() instanceof AkResultSet) {
                outputNestedResultSet((Cursor)value.getObject(),
                                      resultColumn.getNestedResultColumns());
            }
            else {
                FormatOptions options = context.getServer().getFormatOptions();
View Full Code Here

Examples of com.foundationdb.server.types.TInstance.typeClass()

                return dateValue;
            TExecutionContext context =
                new TExecutionContext(Collections.singletonList(dateType),
                                      targetType, null);
            Value result = new Value(targetType);
            targetType.typeClass().fromObject(context, dateValue, result);
            return result;
        }
        else {
            // TODO this is inefficient, but I want to get it working.
            return ValueSources.valuefromObject(value, type.getType());
View Full Code Here

Examples of com.foundationdb.server.types.TInstance.typeClass()

        }

        @Override
        protected ValueSource getValue(int index) {
            TInstance type = getType(index);
            TClass tclass = type.typeClass();
            ValueSource source;
            if (parameterArgs[index] < 0) {
                source = ValueSources.valuefromObject(constantArgs[index], type);
                if (source.getType().typeClass().equals(tclass))
                    return source; // Literal value matches.
View Full Code Here

Examples of com.foundationdb.server.types.TInstance.typeClass()

            TExecutionContext context = new TExecutionContext(null,
                                                              Collections.singletonList(pvalue.type()),
                    type,
                                                              null, null, null, null);
            Value pvalue2 = new Value(type);
            type.typeClass().fromObject(context, pvalue.value(), pvalue2);
            type.writeCollating(pvalue2, keyTarget);
        }
        return key;
    }
View Full Code Here

Examples of com.foundationdb.server.types.TInstance.typeClass()

            TInstance type = column.getType();
            int pos = column.getPosition();
            row[pos] = insertExprs.get(i);
            if(!type.equals(row[pos].resultType())) {
                TCast tcast = registryService().getCastsResolver().cast(row[pos].resultType().typeClass(),
                                                                        type.typeClass());
                row[pos] = new TCastExpression(row[pos], tcast, type);
            }
        }
        // Fill in column defaults
        for(int i = 0, len = targetRowType.nFields(); i < len; ++i) {
View Full Code Here

Examples of com.foundationdb.server.types.TInstance.typeClass()

        for (Column column : table.getColumns()) {
            if (!pkList.contains(column) && upColumns.contains(column)) {
                updates[index] new TPreparedParameter(paramIndex, varchar);
               
                if (!column.getType().equals(varchar)) {
                    TCast cast = registryService().getCastsResolver().cast(varchar.typeClass(),
                            column.getType().typeClass());
                    updates[index] = new TCastExpression(updates[index], cast, column.getType());
                }
                paramIndex++;
            }
View Full Code Here

Examples of com.foundationdb.server.types.TInstance.typeClass()

        for (int i = 0; i < nparams; i++) {
            int usage = invocation.parameterUsage(i);
            if (usage < 0) continue;
            Parameter parameter = invocation.getRoutineParameter(usage);
            TInstance type = parameter.getType();
            int jdbcType = type.typeClass().jdbcType();
            DataTypeDescriptor sqlType = type.dataTypeDescriptor();
            ptypes[i] = new ParameterType(parameter, sqlType, jdbcType, type);
        }
        return new JDBCParameterMetaData(context.getTypesTranslator(), Arrays.asList(ptypes));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.