Package com.mysema.query.types.expr

Examples of com.mysema.query.types.expr.StringExpression


        for (Expression<?> expr : exprs) {
            for (Field field : expr.getClass().getFields()) {
                Object rv = field.get(expr);
                if (rv instanceof Expression) {
                    if (rv instanceof StringExpression) {
                        StringExpression str = (StringExpression)rv;
                        toVisit.add(str.toLowerCase());
                        toVisit.add(str.charAt(0));
                        toVisit.add(str.isEmpty());
                    } else if (rv instanceof BooleanExpression) {
                        BooleanExpression b = (BooleanExpression)rv;
                        toVisit.add(b.not());
                    }
                    toVisit.add((Expression<?>) rv);
View Full Code Here


    }

    @Test
    public void Entity_Case() {
        NumberExpression<Long> longExpr = new NumberPath<Long>(Long.class, "x");
        StringExpression stringExpr = new StringPath("x");

        QQueryProjectionTest_EntityWithProjection.create(longExpr).newInstance(0l);
        QQueryProjectionTest_EntityWithProjection.create(stringExpr).newInstance("");
        QQueryProjectionTest_EntityWithProjection.create(longExpr, stringExpr).newInstance(0l,"");
        QQueryProjectionTest_EntityWithProjection.create(stringExpr,stringExpr).newInstance("","");
View Full Code Here

    }

    @Test
    public void Dto_Case() throws SecurityException, NoSuchMethodException{
        NumberExpression<Long> longExpr = new NumberPath<Long>(Long.class, "x");
        StringExpression stringExpr = new StringPath("x");

        new QQueryProjectionTest_DTOWithProjection(longExpr).newInstance(0l);
        new QQueryProjectionTest_DTOWithProjection(stringExpr).newInstance("");
        new QQueryProjectionTest_DTOWithProjection(longExpr, stringExpr).newInstance(0l,"");
        new QQueryProjectionTest_DTOWithProjection(stringExpr, stringExpr).newInstance("","");
View Full Code Here

    @Test
    public void StringTyped() {
        Customer c = alias(Customer.class, "customer");

        StringExpression cases = $(c.getAnnualSpending())
            .when(1000l).then("bronze")
            .when(2000l).then("silver")
            .when(5000l).then("gold")
            .otherwise("platinum");
View Full Code Here

public class TemplateTest {

    @Test
    public void ToDate() {
        StringExpression str = new StringPath("str");
        assertEquals("to_date(str,'DD-MON-YYYY')", to_date(str, "DD-MON-YYYY").toString());
    }
View Full Code Here

TOP

Related Classes of com.mysema.query.types.expr.StringExpression

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.