Examples of newLiteral()


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

            {
                Object current = it.next();
                if (null != current)
                {
                    JavaTypeMapping m = dba.getMapping(current.getClass(), qs.getStoreManager(), qs.getClassLoaderResolver());
                    ScalarExpression expr = m.newLiteral(qs, current);

                    // Append the SQLExpression (should be a literal) for the
                    // current element.
                    st.append(hadPrev ? "," : "");
                    st.append(expr);
View Full Code Here

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

        DatastoreAdapter dba = qs.getStoreManager().getDatastoreAdapter();
        this.exprs = new ScalarExpression[Array.getLength(value)];
        for( int i=0; i<Array.getLength(value); i++ )
        {
            JavaTypeMapping m = dba.getMapping(Array.get(value, i).getClass(), qs.getStoreManager(), qs.getClassLoaderResolver());
            this.exprs[i] = m.newLiteral(qs, Array.get(value, i));
        }
    }   

    public Object getValue()
    {
View Full Code Here

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

            // We have to create a StateManager here just to map fields from the AppId key object
            // to the table fields. Really the table should have some way of doing this. TODO : Refactor this
            Class pc_class = om.getClassLoaderResolver().classForName(schemaDataOption.getName());
            StateManager sm = StateManagerFactory.newStateManagerForHollow(om,pc_class,id);
            ScalarExpression fieldExpr = idMapping.newScalarExpression(qs, qs.getMainTableExpression());
            ScalarExpression fieldValue = idMapping.newLiteral(qs, sm.getObject());
            qs.andCondition(fieldExpr.eq(fieldValue), true);
            // Discriminator for this class
            JavaTypeMapping discrimMapping = schemaDataOption.getDatastoreContainerObject().getDiscriminatorMapping(false);
            DiscriminatorMetaData discrimMetaData = cmd.getInheritanceMetaData().getDiscriminatorMetaData();
View Full Code Here

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

                }
                else if (cmd.getDiscriminatorStrategy() == DiscriminatorStrategy.VALUE_MAP)
                {
                    value = discrimMetaData.getValue();
                }
                ScalarExpression discrimValue = discrimMapping.newLiteral(qs, value);
                qs.andCondition(discrimExpr.eq(discrimValue), true);
            }

            if (qs_base==null)
            {
View Full Code Here

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

        // We have to create a StateManager here just to map fields from the AppId key object to the table fields.
        // Really the table should have some way of doing this. TODO : Refactor this
        StateManager sm = StateManagerFactory.newStateManagerForHollow(om, objectClass, id);
        JavaTypeMapping idMapping = primaryTable.getIDMapping();
        ScalarExpression fieldExpr = idMapping.newScalarExpression(stmt, stmt.getMainTableExpression());
        ScalarExpression fieldValue = idMapping.newLiteral(stmt, sm.getObject());
        stmt.andCondition(fieldExpr.eq(fieldValue), true);

        // Perform the query
        try
        {
View Full Code Here

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

     **/
    public BooleanExpression startsWithMethod(ScalarExpression source, ScalarExpression str)
    {
        JavaTypeMapping m = getMapping(BigInteger.class, source);
       
        ScalarExpression integerLiteral = m.newLiteral(source.getQueryExpression(), BigInteger.ONE);
        ArrayList args = new ArrayList();
        args.add(source);
        args.add(str);
        ScalarExpression literal = getMapping(BigInteger.class, source).newLiteral(source.getQueryExpression(), BigInteger.ZERO);
        args.add(literal);
View Full Code Here

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

            throw new IllegalArgumentTypeException(rightOperand);
        }
       
        JavaTypeMapping m = getMapping(BigInteger.class, leftOperand);
       
        ScalarExpression integerLiteral = m.newLiteral(leftOperand.getQueryExpression(), BigInteger.ONE);
        ArrayList args = new ArrayList();
        args.add(leftOperand);
        args.add(rightOperand);
        ScalarExpression literal = getMapping(BigInteger.class, leftOperand).newLiteral(leftOperand.getQueryExpression(), BigInteger.ZERO);
        args.add(literal);
View Full Code Here

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

            if (((Boolean)((BooleanLiteral)condition).getValue()).booleanValue())
            {
                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()

            if (((Boolean)((BooleanLiteral)condition).getValue()).booleanValue())
            {
                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()

            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
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.