Examples of NullLiteral


Examples of org.jpox.store.mapped.expression.NullLiteral

                 * WHERE THIS.ELEM_ID IS NULL
                 */
                QueryExpression nullStmt = getQueryForElement(candidateFullClassName,
                    storeMgr.getDatastoreClass(candidateFullClassName, clr), true, candidateAlias);
                ScalarExpression elemIdExpr = sourceMapping.newScalarExpression(nullStmt, nullStmt.getMainTableExpression());
                nullStmt.andCondition(new NullLiteral(nullStmt).eq(elemIdExpr));
                stmt.union(nullStmt);
            }

            return stmt;
        }
View Full Code Here

Examples of org.jpox.store.mapped.expression.NullLiteral

                    ScalarExpression targetElementExpr =
                        targetElementMapping.newScalarExpression(stmt, stmt.getMainTableExpression());
                    targetSubElementTypeExpr = targetMapping.newScalarExpression(stmt, teTargetSubElementType);
                    stmt.leftOuterJoin(targetElementExpr,targetSubElementTypeExpr, teTargetSubElementType, true);
                    ScalarExpression seTargetSubElementType = targetMapping.newScalarExpression(targetQS, teTargetSubElementType);
                    stmt.andCondition(new NullLiteral(stmt).eq(seTargetSubElementType));
                }
            }
        }
    }
View Full Code Here

Examples of org.jpox.store.mapped.expression.NullLiteral

        if ((withMetadata == null && hasSubClasses) ||
            (withMetadata != null && withMetadata.booleanValue()))
        {
            if (allowNull)
            {
                NullLiteral nullLtl = new NullLiteral(stmt);
                nullLtl.as(MetaDataStringLiteral.QUERY_META_DATA);
                stmt.selectScalarExpression(nullLtl);
            }
            else
            {
                String classname = pcClass;
View Full Code Here

Examples of org.jpox.store.mapped.expression.NullLiteral

            }
            if (allowNulls)
            {
                // Allow for null value of discriminator
                ScalarExpression discrExpr = discriminatorMapping.newScalarExpression(stmt, discrimTableExpr);
                ScalarExpression discrVal = new NullLiteral(stmt);
                stmt.iorCondition(discrExpr.eq(discrVal));
            }
        }

        return stmt;
View Full Code Here

Examples of org.jpox.store.mapped.expression.NullLiteral

            }
            else if (p.parseStringIgnoreCase("IS"))
            {
                if (p.parseStringIgnoreCase("NULL"))
                {
                    expr = expr.eq(new NullLiteral(qs));
                }
                else if (p.parseStringIgnoreCase("EMPTY"))
                {
                    ArrayList args = new ArrayList();
                    expr = expr.callMethod("isEmpty",args);
                }
                else if (p.parseStringIgnoreCase("NOT"))
                {
                    if (p.parseStringIgnoreCase("NULL"))
                    {
                        expr = expr.noteq(new NullLiteral(qs));
                    }
                    else if (p.parseStringIgnoreCase("EMPTY"))
                    {
                        ArrayList args = new ArrayList();
                        expr = expr.callMethod("isEmpty",args).not();
View Full Code Here

Examples of org.jpox.store.mapped.expression.NullLiteral

                    paramExpr.checkForTypeAssignability();
                    return paramExpr;
                }
                else
                {
                    return new NullLiteral(qs);
                }
            }

            if (!executionCompile)
            {
View Full Code Here

Examples of org.jpox.store.mapped.expression.NullLiteral

                    paramExpr.checkForTypeAssignability();
                    return paramExpr;
                }
                else
                {
                    return new NullLiteral(qs);
                }
            }

            if (!executionCompile)
            {
View Full Code Here

Examples of org.jpox.store.mapped.expression.NullLiteral

            else
            {
                Object parameterValue = parameters.get(id);
                if (parameterValue == null)
                {
                    expr = new NullLiteral(qs);
                }
                else
                {
                    expr = m.newLiteral(qs, parameterValue);
                    expr.setParameterName(id);
View Full Code Here

Examples of org.jpox.store.mapped.expression.NullLiteral

                        return paramExpr;
                    }
                }
                else
                {
                    return new NullLiteral(qs);
                }
            }

            if (parameters.size() < implicitParamNo+1)
            {
                // Already used up all parameters available
                throw new JPOXUserException(LOCALISER.msg("021056", "" + id, "" + implicitParamNo));
            }

            // Find the next implicit parameter available and assign to this implicit parameter
            if (!parameters.containsKey("JPOX_" + implicitParamNo))
            {
                throw new JPOXUserException(LOCALISER.msg("021056", "" + id, "" + implicitParamNo));
            }
            Object paramValue = parameters.get("JPOX_" + implicitParamNo);

            // Replace the value key with the true name in case its used again
            parameters.put(id, paramValue);
            parameters.remove("JPOX_" + implicitParamNo);
            implicitParamNo++;
            if (paramValue != null)
            {
                if (parentExpr != null && paramValue instanceof String && ((String)paramValue).startsWith("this"))
                {
                    // Subquery with parameter pointing back to a field of the parent query
                    return getExpressionForSubqueryParentParameter((String)paramValue);
                }
                else
                {
                    JavaTypeMapping m = srm.getDatastoreAdapter().getMapping(paramValue.getClass(), srm, clr);
                    ScalarExpression paramExpr = m.newLiteral(qs, paramValue);
                    paramExpr.setParameterName(id);
                    return paramExpr;
                }
            }
            else
            {
                return new NullLiteral(qs);
            }
        }
        else
        {
            if (executionCompile)
            {
                throw new JPOXUserException(LOCALISER.msg("021056", "" + id, "" + implicitParamNo));
            }
            else
            {
                // We have no value available at precompile so just give it a null for now
                return new NullLiteral(qs);
            }
        }
    }
View Full Code Here

Examples of org.springframework.expression.spel.ast.NullLiteral

    SpelNodeImpl expr = eatLogicalOrExpression();
    if (moreTokens()) {
      Token t = peekToken();
      if (t.kind==TokenKind.ASSIGN) { // a=b
        if (expr==null) {
        expr = new NullLiteral(toPos(t.startpos-1,t.endpos-1));
      }
        nextToken();
        SpelNodeImpl assignedValue = eatLogicalOrExpression();
        return new Assign(toPos(t),expr,assignedValue);
      } else if (t.kind==TokenKind.ELVIS) { // a?:b (a if it isn't null, otherwise b)
        if (expr==null) {
          expr = new NullLiteral(toPos(t.startpos-1,t.endpos-2));
        }
        nextToken(); // elvis has left the building
        SpelNodeImpl valueIfNull = eatExpression();
        if (valueIfNull==null) {
          valueIfNull = new NullLiteral(toPos(t.startpos+1,t.endpos+1));
        }
        return new Elvis(toPos(t),expr,valueIfNull);
      } else if (t.kind==TokenKind.QMARK) { // a?b:c
        if (expr==null) {
          expr = new NullLiteral(toPos(t.startpos-1,t.endpos-1));
        }
        nextToken();
        SpelNodeImpl ifTrueExprValue = eatExpression()
        eatToken(TokenKind.COLON);
        SpelNodeImpl ifFalseExprValue = eatExpression()
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.