Package org.jpox.store.mapped.expression

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


            return expr;
        }
        else if (datastoreJavaType.equals(ClassNameConstants.JAVA_LANG_STRING))
        {
            // Return an StringLiteral to represent this Enum, but with the original value present just in case
            ScalarExpression expr = new StringLiteral(qs, this, ((Enum)value).name());
            ((Literal)expr).setRawValue(value);
            return expr;
        }
        else
        {
View Full Code Here


     * @param value The value of the literal
     * @return The Literal
     */
    public ScalarExpression newLiteral(QueryExpression qs, Object value)
    {
        return new StringLiteral(qs, this, objectToString(value));
    }
View Full Code Here

        return ClassNameConstants.JAVA_LANG_STRING;
    }

    public ScalarExpression newLiteral(QueryExpression qs, Object value)
    {
        ScalarExpression expr = new StringLiteral(qs, this, ((StringBuffer)value).toString());
        return expr;
    }
View Full Code Here

        return mappingSampleValue;
    }

    public ScalarExpression newLiteral(QueryExpression qs, Object value)
    {
        ScalarExpression expr = new StringLiteral(qs, this, ((String)value));
        return expr;
    }
View Full Code Here

     */
    public NumericExpression getHourMethod(SqlTemporalExpression time)
    {
        ArrayList args = new ArrayList();
        args.add(time);
        args.add(new StringLiteral(time.getQueryExpression(),null,"%I"));
        ArrayList args0 = new ArrayList();
        args0.add(new StringExpression("TO_CHAR",args));
        ArrayList types = new ArrayList();
        types.add("INTEGER");
        return new NumericExpression("CAST",args0,types);
View Full Code Here

     */
    public NumericExpression getMinuteMethod(SqlTemporalExpression time)
    {
        ArrayList args = new ArrayList();
        args.add(time);
        args.add(new StringLiteral(time.getQueryExpression(),null,"%M"));
        ArrayList args0 = new ArrayList();
        args0.add(new StringExpression("TO_CHAR",args));
        ArrayList types = new ArrayList();
        types.add("INTEGER");
        return new NumericExpression("CAST",args0,types);
View Full Code Here

     */
    public NumericExpression getSecondMethod(SqlTemporalExpression time)
    {
        ArrayList args = new ArrayList();
        args.add(time);
        args.add(new StringLiteral(time.getQueryExpression(),null,"%S"));
        ArrayList args0 = new ArrayList();
        args0.add(new StringExpression("TO_CHAR",args));
        ArrayList types = new ArrayList();
        types.add("INTEGER");
        return new NumericExpression("CAST",args0,types);
View Full Code Here

        if (!(rightOperand instanceof StringExpression))
        {
            throw new IllegalArgumentTypeException(rightOperand);
        }
       
        StringLiteral pct = new StringLiteral(leftOperand.getQueryExpression(), leftOperand.getMapping(), '%');
        return new BooleanExpression(leftOperand, ScalarExpression.OP_LIKE, pct.add(leftOperand.getQueryExpression().getStoreManager().getDatastoreAdapter().getEscapedPatternExpression(rightOperand)));
    }
View Full Code Here

    public StringExpression toStringExpression(NumericExpression expr)
    {
        if( expr instanceof Literal )
        {
            JavaTypeMapping m = getMapping(String.class, expr);
            return new StringLiteral(expr.getQueryExpression(),m,((Literal)expr).getValue().toString());           
        }
        List args = new ArrayList();
        args.add(expr);       
        List types = new ArrayList();
        types.add("VARCHAR(4000)");       
View Full Code Here

            stmt.getTableExpression(collectionTableAlias));
        stmt.andCondition(ownerExpr.eq(ownerInCollectionExpr));

        // Select COUNT(*)
        JavaTypeMapping m = dba.getMapping(String.class, storeMgr);
        StringLiteral lit = (StringLiteral)m.newLiteral(stmt, "COUNT(*)");
        lit.generateStatementWithoutQuotes();
        stmt.selectScalarExpression(lit);

        // TODO This needs to restrict the discriminator also where it is present (see sizeStmt)

        return stmt;
View Full Code Here

TOP

Related Classes of org.jpox.store.mapped.expression.StringLiteral

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.