Package com.foundationdb.server.types

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


                   int arg0Precision = arg0.attribute(DecimalAttribute.PRECISION);
                   int arg0Scale = arg0.attribute(DecimalAttribute.SCALE);

                   int arg1Precision = arg1.attribute(DecimalAttribute.PRECISION);
                   int arg1Scale = arg1.attribute(DecimalAttribute.SCALE);
                   long resultPrecisionAndScale = precisionAndScale(arg0Precision, arg0Scale, arg1Precision, arg1Scale);
                   int resultPrecision = (int)(resultPrecisionAndScale >> 32);
                   int resultScale = (int)resultPrecisionAndScale;
                   return MNumeric.DECIMAL.instance(resultPrecision, resultScale, anyContaminatingNulls(inputs));
               }
View Full Code Here


                    if (topIsCommon && botIsCommon) {
                        // TODO: The special case here for TClass VARCHAR with mismatched charsets
                        // is a limitation of the TClass#pickInstance, as there is no current way
                        // to create a common TInstance for TString with difference charsets.
                        if (commonTClass instanceof TString &&
                            botInstance.attribute(StringAttribute.CHARSET) != instances[field].attribute(StringAttribute.CHARSET)) {
                            ;
                        }
                        else {   
                            instances[field] = topClass.pickInstance(instances[field], botInstance);
                        }
View Full Code Here

        @Override
        public void doEvaluate(TExecutionContext context, ValueSource source, ValueTarget target) {
            String in = source.getString();
            TInstance outputType = context.outputType();
            int maxLen = outputType.attribute(StringAttribute.MAX_LENGTH);
            String truncated = Strings.truncateIfNecessary(in, maxLen);
            if (in != truncated) {
                context.reportTruncate(in, truncated);
                in = truncated;
            }
View Full Code Here

        }
   
        @Override
        public TInstance preferredTarget(TPreptimeValue source) {
            TInstance sourceType =  source.type();
            return targetClass().instance(sourceType.attribute(StringAttribute.MAX_LENGTH),
                    sourceType.attribute(StringAttribute.CHARSET),
                    sourceType.attribute(StringAttribute.COLLATION),
                    source.isNullable());
        }
    }
View Full Code Here

   
        @Override
        public TInstance preferredTarget(TPreptimeValue source) {
            TInstance sourceType =  source.type();
            return targetClass().instance(sourceType.attribute(StringAttribute.MAX_LENGTH),
                    sourceType.attribute(StringAttribute.CHARSET),
                    sourceType.attribute(StringAttribute.COLLATION),
                    source.isNullable());
        }
    }
View Full Code Here

        @Override
        public TInstance preferredTarget(TPreptimeValue source) {
            TInstance sourceType =  source.type();
            return targetClass().instance(sourceType.attribute(StringAttribute.MAX_LENGTH),
                    sourceType.attribute(StringAttribute.CHARSET),
                    sourceType.attribute(StringAttribute.COLLATION),
                    source.isNullable());
        }
    }

    private Cast_From_Text() {}
View Full Code Here

            @Override
            public TInstance resultInstance(List<TPreptimeValue> inputs, TPreptimeContext context)
            {
                TInstance source = inputs.get(parameterIndex).type();
                assert source.typeClass() instanceof TString : "customStringFromParameter only works with TStrings";
                return source.typeClass().instance(source.attribute(StringAttribute.MAX_LENGTH),
                        source.attribute(StringAttribute.CHARSET),
                        source.attribute(StringAttribute.COLLATION),
                        anyContaminatingNulls(inputs));
            }
        });
View Full Code Here

            public TInstance resultInstance(List<TPreptimeValue> inputs, TPreptimeContext context)
            {
                TInstance source = inputs.get(parameterIndex).type();
                assert source.typeClass() instanceof TString : "customStringFromParameter only works with TStrings";
                return source.typeClass().instance(source.attribute(StringAttribute.MAX_LENGTH),
                        source.attribute(StringAttribute.CHARSET),
                        source.attribute(StringAttribute.COLLATION),
                        anyContaminatingNulls(inputs));
            }
        });
    }
View Full Code Here

            {
                TInstance source = inputs.get(parameterIndex).type();
                assert source.typeClass() instanceof TString : "customStringFromParameter only works with TStrings";
                return source.typeClass().instance(source.attribute(StringAttribute.MAX_LENGTH),
                        source.attribute(StringAttribute.CHARSET),
                        source.attribute(StringAttribute.COLLATION),
                        anyContaminatingNulls(inputs));
            }
        });
    }
   
View Full Code Here

        inAIS.getTable(SCHEMA, CAOIBuilderFiller.ORDER_TABLE).
                setCharsetAndCollation("utf16", "sv_se_ci");
        Column column = inAIS.getTable(SCHEMA, CAOIBuilderFiller.CUSTOMER_TABLE).getColumn("customer_name");
        TInstance type = column.getType();
        type = type.typeClass().instance(
                        type.attribute(StringAttribute.MAX_LENGTH),
                        StringFactory.Charset.LATIN1.ordinal(),
                        AkCollatorFactory.getAkCollator("en_us").getCollationId(),
                        type.nullability());
        column.setType(type);
        inAIS.freeze();
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.