Package org.teiid.language

Examples of org.teiid.language.Function


       
        helpGetString1(func,  "cast(123 AS smallint)")//$NON-NLS-1$
    }
   
    @Test public void testFloatToByte() throws Exception {
        Function func = LANG_FACTORY.createFunction("convert"//$NON-NLS-1$
            new Expression[] {
                LANG_FACTORY.createLiteral(new Float((float) 123.0), Float.class),
                LANG_FACTORY.createLiteral("byte",  Byte.class)}, //$NON-NLS-1$
            Byte.class);
       
View Full Code Here


       
        helpGetString1(func,  "cast(123.0 AS smallint)")//$NON-NLS-1$
    }
   
    @Test public void testDoubleToByte() throws Exception {
        Function func = LANG_FACTORY.createFunction("convert"//$NON-NLS-1$
            new Expression[] {
                LANG_FACTORY.createLiteral(new Double(1.0), Double.class),
                LANG_FACTORY.createLiteral("byte",  Byte.class)}, //$NON-NLS-1$
            Byte.class);
       
View Full Code Here

       
        helpGetString1(func,  "cast(1.0 AS smallint)")//$NON-NLS-1$
    }
   
    @Test public void testBigDecimalToByte() throws Exception {
        Function func = LANG_FACTORY.createFunction("convert"//$NON-NLS-1$
            new Expression[] {
                LANG_FACTORY.createLiteral(new java.math.BigDecimal("12.3"), java.math.BigDecimal.class), //$NON-NLS-1$
                LANG_FACTORY.createLiteral("byte",  Byte.class)}, //$NON-NLS-1$
            Byte.class);
       
View Full Code Here

    /***************** End of cast(byte AS input)******************/

    /*****************Beginning of cast(short AS input)************/
    @Test public void testStringToShort() throws Exception {
        Function func = LANG_FACTORY.createFunction("convert"//$NON-NLS-1$
            new Expression[] {
                LANG_FACTORY.createLiteral("123", String.class)//$NON-NLS-1$
                LANG_FACTORY.createLiteral("short", Short.class)}, //$NON-NLS-1$
            Short.class);
       
View Full Code Here

       
        helpGetString1(func,  "cast('123' AS smallint)")//$NON-NLS-1$
    }   
   
    @Test public void testBooleanToShorta() throws Exception {
        Function func = LANG_FACTORY.createFunction("convert"//$NON-NLS-1$
            new Expression[] {
                LANG_FACTORY.createLiteral(Boolean.TRUE, Boolean.class),
                LANG_FACTORY.createLiteral("short", Short.class)}, //$NON-NLS-1$
            Short.class);
       
View Full Code Here

       
        helpGetString1(func,  "1")//$NON-NLS-1$
   
   
    @Test public void testByteToShort() throws Exception {
        Function func = LANG_FACTORY.createFunction("convert"//$NON-NLS-1$
            new Expression[] {
                LANG_FACTORY.createLiteral(new Byte((byte) 12), Byte.class),
                LANG_FACTORY.createLiteral("short",  Short.class)}, //$NON-NLS-1$
            Short.class);
       
View Full Code Here

       
        helpGetString1(func,  "12")//$NON-NLS-1$
    }

    @Test public void testIntegerToShort() throws Exception {
        Function func = LANG_FACTORY.createFunction("convert"//$NON-NLS-1$
            new Expression[] {
                LANG_FACTORY.createLiteral(new Integer(1232321), Integer.class),
                LANG_FACTORY.createLiteral("short",  Short.class)}, //$NON-NLS-1$
            Short.class);
       
View Full Code Here

       
        helpGetString1(func,  "cast(1232321 AS smallint)")//$NON-NLS-1$
    }
   
    @Test public void testLongToShort() throws Exception {
        Function func = LANG_FACTORY.createFunction("convert"//$NON-NLS-1$
            new Expression[] {
                LANG_FACTORY.createLiteral(new Long(1231232341), Long.class),
                LANG_FACTORY.createLiteral("short",  Short.class)}, //$NON-NLS-1$
            Short.class);
       
View Full Code Here

       
        helpGetString1(func,  "cast(1231232341 AS smallint)")//$NON-NLS-1$
    }
   
    @Test public void testBigIntegerToShort() throws Exception {
        Function func = LANG_FACTORY.createFunction("convert"//$NON-NLS-1$
            new Expression[] {
                LANG_FACTORY.createLiteral(new java.math.BigInteger("123"), java.math.BigInteger.class), //$NON-NLS-1$
                LANG_FACTORY.createLiteral("short",  Short.class)}, //$NON-NLS-1$
            Short.class);
       
View Full Code Here

       
        helpGetString1(func,  "cast(123 AS smallint)")//$NON-NLS-1$
    }
   
    @Test public void testFloatToShort() throws Exception {
        Function func = LANG_FACTORY.createFunction("convert"//$NON-NLS-1$
            new Expression[] {
                LANG_FACTORY.createLiteral(new Float((float) 123.0), Float.class),
                LANG_FACTORY.createLiteral("short",  Short.class)}, //$NON-NLS-1$
            Short.class);
       
View Full Code Here

TOP

Related Classes of org.teiid.language.Function

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.