Package org.datanucleus.store.mapped.expression

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


     * @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 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

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

        // Select COUNT(*)
        JavaTypeMapping m = storeMgr.getMappingManager().getMapping(String.class);
        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

        return String.class;
    }

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

        ScalarExpression ownerInCollectionExpr = ownerMapping.newScalarExpression(stmt, stmt.getTableExpression(mapTableAlias));
        stmt.andCondition(ownerExpr.eq(ownerInCollectionExpr));

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

        return stmt;
    }
View Full Code Here

        ScalarExpression ownerInCollectionExpr = ownerMapping.newScalarExpression(stmt, stmt.getTableExpression(arrayTableAlias));
        stmt.andCondition(ownerExpr.eq(ownerInCollectionExpr));

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

        return stmt;
    }
View Full Code Here

        return StringBuffer.class;
    }

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

TOP

Related Classes of org.datanucleus.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.