Package com.foundationdb.server.types

Examples of com.foundationdb.server.types.TPreptimeValue.type()


            TPreptimeValue constantTpv = overload.evaluateConstant(context, overload.filterInputs(lazyInputs));
            if (constantTpv != null) {
                TPreptimeValue oldTpv = expression.getPreptimeValue();
                assert oldTpv.type().equals(constantTpv.type())
                        : oldTpv.type() + " != " + constantTpv.type();
                expression.setPreptimeValue(constantTpv);
            }

            SparseArray<Object> values = context.getValues();
            if ((values != null) && !values.isEmpty())
View Full Code Here


            List<ExpressionNode> siblings = siblings(parameterExpression);
            if (siblings.isEmpty()) {
                preptimeValue = new TPreptimeValue();
                if (parameterExpression.getSQLsource() != null)
                    // Start with type client intends to send, if any.
                    preptimeValue.type((TInstance) parameterExpression.getSQLsource().getUserData());
                parameterExpression.setPreptimeValue(new TPreptimeValue());
            }
            else {
                preptimeValue = siblings.get(0).getPreptimeValue();
            }
View Full Code Here

        }

        public void set(ExpressionNode node, TInstance type) {
            List<ExpressionNode> siblings = siblings((ParameterExpression) node);
            TPreptimeValue sharedTpv = siblings.get(0).getPreptimeValue();
            TInstance previousInstance = sharedTpv.type();
            type = commonInstance(resolver, type, previousInstance);
            sharedTpv.type(type);
        }

        public void updateTypes(TypesTranslator typesTranslator) {
View Full Code Here

        public void set(ExpressionNode node, TInstance type) {
            List<ExpressionNode> siblings = siblings((ParameterExpression) node);
            TPreptimeValue sharedTpv = siblings.get(0).getPreptimeValue();
            TInstance previousInstance = sharedTpv.type();
            type = commonInstance(resolver, type, previousInstance);
            sharedTpv.type(type);
        }

        public void updateTypes(TypesTranslator typesTranslator) {
            int nparams = instancesMap.lastDefinedIndex();
            for (int i = 0; i < nparams; i++) {
View Full Code Here

            int nparams = instancesMap.lastDefinedIndex();
            for (int i = 0; i < nparams; i++) {
                if (!instancesMap.isDefined(i)) continue;
                List<ExpressionNode> siblings = instancesMap.get(i);
                TPreptimeValue sharedTpv = siblings.get(0).getPreptimeValue();
                TInstance type = sharedTpv.type();
                DataTypeDescriptor sqlType = null;
                if (type == null) {
                    sqlType = siblings.get(0).getSQLtype();
                    if (sqlType != null)
                        type = typesTranslator.typeForSQLType(sqlType);
View Full Code Here

                    sqlType = siblings.get(0).getSQLtype();
                    if (sqlType != null)
                        type = typesTranslator.typeForSQLType(sqlType);
                    else
                        type = typesTranslator.typeClassForString().instance(true);
                    sharedTpv.type(type);
                }
                if (sqlType == null)
                    sqlType = type.dataTypeDescriptor();
                for (ExpressionNode param : siblings) {
                    param.setSQLtype(sqlType);
View Full Code Here

        return (type == null) ? null : type.typeClass();
    }

    private static TInstance type(ExpressionNode node) {
        TPreptimeValue ptv = node.getPreptimeValue();
        return ptv == null ? null : ptv.type();
    }

    private static TInstance commonInstance(TCastResolver resolver, ExpressionNode left, ExpressionNode right) {
        return commonInstance(resolver, type(left), type(right));
    }
View Full Code Here

        }

        protected Constantness isConstant(ExpressionNode expr) {
            TPreptimeValue tpv = expr.getPreptimeValue();
            ValueSource value = tpv.value();
            if (tpv.type() == null) {
                assert value == null || value.isNull() : value;
                assert !(expr instanceof ParameterExpression) : value;
                return Constantness.NULL;
            }
            if (value == null)
View Full Code Here

    private TPreparedExpression tryLiteral(ExpressionNode node) {
        TPreparedExpression result = null;
        TPreptimeValue tpv = node.getPreptimeValue();
        if (tpv != null) {
            TInstance type = tpv.type();
            ValueSource value = tpv.value();
            if (type != null && value != null)
                result = new TPreparedLiteral(type, value);
        }
        return result;
View Full Code Here

        return result;
    }

    private TPreparedExpression literal(ConstantExpression expression) {
        TPreptimeValue ptval = expression.getPreptimeValue();
        return new TPreparedLiteral(ptval.type(), ptval.value());
    }

    private TPreparedExpression variable(ParameterExpression expression) {
        return new TPreparedParameter(expression.getPosition(), expression.getType());
    }
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.