Examples of StringPath


Examples of com.mysema.query.types.path.StringPath

    @Test
    public void Constructors() {
        Templates templates = new JavaTemplates();
        Template template = TemplateFactory.DEFAULT.create("{0}");
        ImmutableList<Expression<?>> args = ImmutableList.<Expression<?>>of(new StringPath("a"));
        List<TemplateExpression<?>> customs = Arrays.<TemplateExpression<?>>asList(
            new BooleanTemplate(template, args),
            new ComparableTemplate<String>(String.class, template, args),
            new DateTemplate<java.sql.Date>(java.sql.Date.class, template, args),
            new DateTimeTemplate<Date>(Date.class, template, args),
View Full Code Here

Examples of com.mysema.query.types.path.StringPath

public class ExpressionSerializationTest {

    @Test
    public void Serialize() throws ClassNotFoundException, IOException {
        QTuple e = new QTuple(new StringPath("x"), new NumberPath(Integer.class, "y"));
        serialize(e);
        serialize(e.newInstance("a",1));
    }
View Full Code Here

Examples of com.mysema.query.types.path.StringPath

public class QListTest {

    @Test
    public void NewInstance() {
        QList qList = new QList(new StringPath("a"), new StringPath("b"));
        List<?> list = qList.newInstance("a", null);
        assertEquals(2, list.size());
        assertEquals("a", list.get(0));
        assertNull(list.get(1));
    }
View Full Code Here

Examples of com.mysema.query.types.path.StringPath

        }
    };

    @Test
    public void Operation() {
        Expression<String> str = new StringPath(new PathImpl(Object.class, "customer"), "name");
        Expression<String> str2 = new StringPath("str");
        Expression<String> concat = Expressions.stringOperation(Ops.CONCAT, str, str2);
        assertEquals("customer.name + str", concat.toString());
        assertEquals("customer_.name + str_", concat.accept(visitor, null).toString());
    }
View Full Code Here

Examples of com.mysema.query.types.path.StringPath

        assertEquals("customer_.name + str_", concat.accept(visitor, null).toString());
    }

    @Test
    public void TemplateExpression() {
        Expression<String> str = new StringPath(new PathImpl(Object.class, "customer"), "name");
        Expression<String> str2 = new StringPath("str");
        Expression<String> concat = Expressions.stringTemplate("{0} + {1}", str, str2);
        assertEquals("customer.name + str", concat.toString());
        assertEquals("customer_.name + str_", concat.accept(visitor, null).toString());
    }
View Full Code Here

Examples of com.mysema.query.types.path.StringPath

    public void Alias() {
        Expression<?> expr = str1.as("s");
        QTuple qTuple = new QTuple(expr);
        Tuple tuple = qTuple.newInstance("arg");
        assertEquals("arg", tuple.get(expr));
        assertEquals("arg", tuple.get(new StringPath("s")));
    }
View Full Code Here

Examples of com.mysema.query.types.path.StringPath

    private static final BooleanExpression a = new BooleanPath("a"), b = new BooleanPath("b");
   
    @Test
    public void As() {
        assertEquals("null as str", Expressions.as(null, str).toString());
        assertEquals("s as str", Expressions.as(new StringPath("s"), str).toString());
    }
View Full Code Here

Examples of com.mysema.query.types.path.StringPath

     *
     * @param variable
     * @return
     */
    public static StringPath stringPath(String variable) {
        return new StringPath(PathMetadataFactory.forVariable(variable));
    }
View Full Code Here

Examples of com.mysema.query.types.path.StringPath

     * @param parent
     * @param property
     * @return
     */
    public static StringPath stringPath(Path<?> parent, String property) {
        return new StringPath(PathMetadataFactory.forProperty(parent, property));
    }
View Full Code Here

Examples of com.mysema.query.types.path.StringPath

        assertEquals(Color.RED, conversions.newInstance(2).get(color));
    }

    @Test
    public void Safe_Number_Conversion() {
        StringPath strPath = new StringPath("strPath");
        NumberPath<Integer> intPath = new NumberPath<Integer>(Integer.class, "intPath");
        QTuple qTuple = new QTuple(strPath, intPath);
        NumberConversions<Tuple> conversions = new NumberConversions<Tuple>(qTuple);
        assertNotNull(conversions.newInstance(1, 2));
    }
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.