Package com.foundationdb.server.types

Examples of com.foundationdb.server.types.TInstance


        table = ais().getTable(tableName);
        RowStream stream = new RowStream ();
        stream.operator = indexAncestorLookup(tableName);
        stream.rowType = schema().tableRowType(table);

        TInstance varchar = getTypesTranslator().typeForString();
        TPreparedExpression[] updates = new TPreparedExpression[table.getColumns().size()];

        // The Primary Key columns have already been added as query parameters
        // by the indexAncestorLookup ($1,,) So start the new parameters from there
        // And we don't want to add the PK columns as to be updated.
        List<Column> pkList = table.getPrimaryKey().getColumns();
        int paramIndex = pkList.size();
        int index = 0;
        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


        else {
            sqlType = new DataTypeDescriptor(typeId,
                                             metaData.isNullable(columnIndex) != ResultSetMetaData.columnNoNulls,
                                             metaData.getColumnDisplaySize(columnIndex));
        }
        TInstance type = typesTranslator.typeForSQLType(sqlType);
        return PostgresType.fromDerby(sqlType, type);
    }
View Full Code Here

                                                 TypesTranslator typesTranslator)
    {
        List<PostgresType> columnTypes = new ArrayList<>();
        for (int jdbcType : plan.jdbcTypes()) {
            DataTypeDescriptor sqlType = DataTypeDescriptor.getBuiltInDataTypeDescriptor(jdbcType);
            TInstance type = typesTranslator.typeForSQLType(sqlType);
            columnTypes.add(PostgresType.fromDerby(sqlType, type));
        }
        return columnTypes;
    }
View Full Code Here

        List<ResultColumn> columns = new ArrayList<>(jdbcTypes.length);
        for (int i = 0; i < jdbcTypes.length; i++) {
            String name = columnNames.get(i);
            int jdbcType = jdbcTypes[i];
            DataTypeDescriptor sqlType = DataTypeDescriptor.getBuiltInDataTypeDescriptor(jdbcType);
            TInstance type = context.getTypesTranslator().typeForSQLType(sqlType);
            ResultColumn column = new ResultColumn(name, jdbcType, sqlType,
                                                   null, type, null);
            columns.add(column);
        }
        return new JDBCResultSetMetaData(context.getTypesTranslator(), columns);
View Full Code Here

        int len = 0;
        for (ParameterNode parameter : parameters) {
            int pos = parameter.getParameterNumber();
            if (len < pos + 1)
                len = pos + 1;
            TInstance type = (TInstance)parameter.getUserData();
            if (type != null) {
                types[pos] = type.toStringConcise(true);
            }
            else {
                types[pos] = Objects.toString(parameter.getType());
            }
        }
View Full Code Here

        ParameterType[] ptypes = new ParameterType[nparams];
        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

    @Override
    public String toString() {
        Object typeDescriptor;
        TPreptimeValue tpv = getPreptimeValue();
        if (tpv != null) {
            TInstance type = tpv.type();
            typeDescriptor = type == null ? "<unknown>" : type;
        }
        else {
            typeDescriptor = getSQLtype();
        }
View Full Code Here

                    projectType = leftType;
                } else {
                    projectType = leftType.getDominantType(rightType);
                }
                assert (projectType != null);
                TInstance type = typesTranslator.typeForSQLType(projectType);
                //projectType = setNode.getResultColumns().get(i).getExpression().getType();
                results.add(resultColumn(setNode.getResultColumns().get(i), i, projectType));
                projects.add(new ColumnExpression (useProject, i, projectType, useProject.getFields().get(i).getSQLsource(), type));
            }           
            SetPlanNode newSetNode = new SetPlanNode(left, right, setOperatorNode.isAll(), opName);
View Full Code Here

        protected void addCondition(List<ConditionExpression> conditions,
                                    ValueNode condition,
                                    List<ExpressionNode> projects)
                throws StandardException {
            DataTypeDescriptor conditionType = null;
            TInstance conditionInst = null;
            switch (condition.getNodeType()) {
            case NodeTypes.BINARY_EQUALS_OPERATOR_NODE:
                addComparisonCondition(conditions, projects,
                                       (BinaryOperatorNode)condition, Comparison.EQ);
                return;
View Full Code Here

                                              List<ExpressionNode> projects,
                                              BinaryOperatorNode binop, Comparison op)
                throws StandardException {
            ExpressionNode left = toExpression(binop.getLeftOperand(), projects);
            ExpressionNode right = toExpression(binop.getRightOperand(), projects);
            TInstance type = typesTranslator.typeForSQLType(binop.getType());
            conditions.add(new ComparisonCondition(op, left, right,
                                                   binop.getType(), binop, type));
        }
View Full Code Here

TOP

Related Classes of com.foundationdb.server.types.TInstance

Copyright © 2018 www.massapicom. 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.