Package org.datanucleus.store.rdbms.sql.expression

Examples of org.datanucleus.store.rdbms.sql.expression.BooleanLiteral


        }
        if (!expr.hasClosure())
        {
            // Add closure to the boolean expression
            return new BooleanExpression(expr, Expression.OP_EQ,
                new BooleanLiteral(stmt, expr.getJavaTypeMapping(), Boolean.TRUE, null));
        }
        return expr;
    }
View Full Code Here


        {
            MapLiteral lit = (MapLiteral)mapExpr;
            Map map = (Map)lit.getValue();
            if (map == null || map.size() == 0)
            {
                return new BooleanLiteral(stmt, expr.getJavaTypeMapping(), Boolean.FALSE);
            }

            // TODO If valExpr is a parameter and mapExpr is derived from a parameter ?
            MapValueLiteral mapValueLiteral = lit.getValueLiteral();
            BooleanExpression bExpr = null;
View Full Code Here

        if (expr instanceof CollectionLiteral)
        {
            Collection coll = (Collection)((CollectionLiteral)expr).getValue();
            boolean isEmpty = (coll == null || coll.size() == 0);
            JavaTypeMapping m = exprFactory.getMappingForType(boolean.class, false);
            return new BooleanLiteral(stmt, m, isEmpty ? Boolean.TRUE : Boolean.FALSE);
        }
        else
        {
            AbstractMemberMetaData mmd = ((CollectionExpression)expr).getJavaTypeMapping().getMemberMetaData();
            if (mmd.isSerialized())
View Full Code Here

            MapLiteral lit = (MapLiteral)expr;
            Map map = (Map)lit.getValue();
            if (map == null || map.size() == 0)
            {
                JavaTypeMapping m = exprFactory.getMappingForType(boolean.class, true);
                return new BooleanLiteral(stmt, m, Boolean.FALSE);
            }

            // TODO If keyExpr is a parameter and mapExpr is derived from a parameter ?
            MapKeyLiteral mapKeyLiteral = lit.getKeyLiteral();
            BooleanExpression bExpr = null;
View Full Code Here

        if (expr instanceof MapLiteral)
        {
            Map map = (Map)((MapLiteral)expr).getValue();
            boolean isEmpty = (map == null || map.size() == 0);
            JavaTypeMapping m = exprFactory.getMappingForType(boolean.class, false);
            return new BooleanLiteral(stmt, m, isEmpty ? Boolean.TRUE : Boolean.FALSE);
        }
        else
        {
            SQLExpression sizeExpr = exprFactory.invokeMethod(stmt, Map.class.getName(), "size", expr, args);
            JavaTypeMapping mapping = exprFactory.getMappingForType(Integer.class, true);
View Full Code Here

        {
            MapLiteral lit = (MapLiteral)mapExpr;
            Map map = (Map)lit.getValue();
            if (map == null || map.size() == 0)
            {
                return new BooleanLiteral(stmt, expr.getJavaTypeMapping(), Boolean.FALSE);
            }
            // TODO Handle this
            return lit.getValueLiteral().invoke("contains", args);
        }
        else
View Full Code Here

        if (expr instanceof StringLiteral && likeExpr instanceof StringLiteral)
        {
            // String.matches(String) so evaluate in-memory
            String primary = (String)((StringLiteral)expr).getValue();
            String pattern = (String)((StringLiteral)likeExpr).getValue();
            return new BooleanLiteral(stmt,
                exprFactory.getMappingForType(boolean.class, false), primary.matches(pattern));
        }
        else if (expr instanceof StringLiteral)
        {
            return getBooleanLikeExpression(expr, likeExpr, escapeExpr);
View Full Code Here

        if (expr instanceof ArrayLiteral)
        {
            Object arr = ((ArrayLiteral)expr).getValue();
            boolean isEmpty = (arr == null || Array.getLength(arr) == 0);
            JavaTypeMapping m = exprFactory.getMappingForType(boolean.class, false);
            return new BooleanLiteral(stmt, m, isEmpty ? Boolean.TRUE : Boolean.FALSE);
        }
        else
        {
            SQLExpression sizeExpr = exprFactory.invokeMethod(stmt, "ARRAY", "size", expr, args);
            JavaTypeMapping mapping = exprFactory.getMappingForType(Integer.class, true);
View Full Code Here

TOP

Related Classes of org.datanucleus.store.rdbms.sql.expression.BooleanLiteral

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.