Examples of newLiteral()


Examples of org.jpox.store.mapped.mapping.JavaTypeMapping.newLiteral()

            if (condition.toStatementText(ScalarExpression.FILTER).toStatementString(ScalarExpression.FILTER).equals("TRUE"))
            {
                return;
            }      
            JavaTypeMapping m = storeMgr.getDatastoreAdapter().getMapping(Integer.class, storeMgr);
            condition = m.newLiteral(this, new Integer("1")).eq(m.newLiteral(this, new Integer("0")));
        }

        if (whereExpr == null)
        {
            whereExpr = condition;
View Full Code Here

Examples of org.jpox.store.mapped.mapping.JavaTypeMapping.newLiteral()

                }
            }
            else
            {
                JavaTypeMapping m = rdbmsAdapter.getMapping(Integer.class, storeMgr);
                stmtText.append(m.newLiteral(this, new Integer("1")).toStatementText(ScalarExpression.PROJECTION).toStatementString(ScalarExpression.PROJECTION));
            }

            /*
             * 1. Push joins down
             * 2. try to make sure joins refer to previous table in stack
View Full Code Here

Examples of org.jpox.store.mapped.mapping.JavaTypeMapping.newLiteral()

        ArrayList args1 = new ArrayList();
        args1.add(new StringExpression("TO_CHAR", args));

        // Delete one from the SQL "month" (origin=1) to be compatible with Java month (origin=0)
        JavaTypeMapping m = getMapping(BigInteger.class, date);
        ScalarExpression integerLiteral = m.newLiteral(date.getQueryExpression(), BigInteger.ONE);
        NumericExpression expr = new NumericExpression(new NumericExpression("TO_NUMBER", args1), ScalarExpression.OP_SUB, integerLiteral);

        expr.encloseWithInParentheses();
        return expr;
    }
View Full Code Here

Examples of org.jpox.store.mapped.mapping.JavaTypeMapping.newLiteral()

            BooleanExpression elementsExpr = null;
            for (Iterator it = userCandidates.iterator(); it.hasNext();)
            {
                Object candidateValue = it.next();
                ScalarExpression expr = m.newScalarExpression(stmt, stmt.getMainTableExpression());
                BooleanExpression keyExpr = expr.eq(m.newLiteral(stmt, candidateValue));
                if (elementsExpr == null)
                {
                    elementsExpr = keyExpr;
                }
                else
View Full Code Here

Examples of org.jpox.store.mapped.mapping.JavaTypeMapping.newLiteral()

        if (stmt.getNumberOfScalarExpressions()<1)
        {
            //force using at least SELECT 1 FROM XXXX
            JavaTypeMapping mapping = storeMgr.getDatastoreAdapter().getMapping(BigInteger.class, storeMgr);
            stmt.selectScalarExpression(mapping.newLiteral(stmt, BigInteger.ONE));

            // Catch the situation where we have no selected columns, and hence the SELECT has no content
            //throw new JDOUserException("The query has resulted in SQL that has no columns in the SELECT clause. This may be due to a feature not yet supported by JPOX.");
        }
        StatementExpressionIndex[] statementExpressionIndex = (StatementExpressionIndex[]) stmtExprIndex.toArray(new StatementExpressionIndex[stmtExprIndex.size()]);
View Full Code Here

Examples of org.jpox.store.mapped.mapping.JavaTypeMapping.newLiteral()

          value = StringUtils.replaceAll(value,"\\","\\\\");
          value = StringUtils.replaceAll(value,"%","\\%");
          value = StringUtils.replaceAll(value,"_","\\_");
            JavaTypeMapping m = getMapping(String.class, patternExpression);

          return m.newLiteral(patternExpression.getQueryExpression(),value);
        }
        else
        {
            return patternExpression;
        }
View Full Code Here

Examples of org.jpox.store.mapped.mapping.JavaTypeMapping.newLiteral()

     * @return The text of the SQL expression.
     */
    public NumericExpression indexOfMethod(ScalarExpression source, ScalarExpression str, NumericExpression from)
    {
        JavaTypeMapping m = getMapping(BigInteger.class, source);
        ScalarExpression integerLiteral = m.newLiteral(source.getQueryExpression(), BigInteger.ONE);

        ArrayList args = new ArrayList();
        args.add(str);
        args.add(source);
        if (from != null)
View Full Code Here

Examples of org.jpox.store.mapped.mapping.JavaTypeMapping.newLiteral()

        ArrayList args = new ArrayList();
        args.add(date);

        // Delete one from the SQL "month" (origin=1) to be compatible with Java month (origin=0)
        JavaTypeMapping m = getMapping(BigInteger.class, date);
        ScalarExpression integerLiteral = m.newLiteral(date.getQueryExpression(), BigInteger.ONE);
        NumericExpression expr = new NumericExpression(new NumericExpression("MONTH", args), ScalarExpression.OP_SUB, integerLiteral);
        expr.encloseWithInParentheses();
        return expr;
    }
View Full Code Here

Examples of org.jpox.store.mapped.mapping.JavaTypeMapping.newLiteral()

            return null;
        }

        JavaTypeMapping m = qs.getStoreManager().getDatastoreAdapter().getMapping(litType,
            qs.getStoreManager(), qs.getClassLoaderResolver());
        return m.newLiteral(qs, litValue);
    }

    /**
     * Method to generate an expression for a new object.
     * Parser has just parsed "new" and what follows is of the form
View Full Code Here

Examples of org.jpox.store.mapped.mapping.JavaTypeMapping.newLiteral()

                // Get the MetaData for the target class since that holds the "value"
                AbstractClassMetaData targetCmd = storeMgr.getOMFContext().getMetaDataManager().getMetaDataForClass(targetElementType, clr);
                discriminatorValue = targetCmd.getInheritanceMetaData().getDiscriminatorMetaData().getValue();
            }
            ScalarExpression discrExpr = discriminatorMapping.newScalarExpression(stmt, discriminatorTableExpr);
            ScalarExpression discrVal = discriminatorMapping.newLiteral(stmt, discriminatorValue);
            stmt.andCondition(discrExpr.eq(discrVal));
        }

        if (withMetadata == null || withMetadata.booleanValue())
        {
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.