Package org.jpox.store.mapped.query

Examples of org.jpox.store.mapped.query.StatementText$Parameter


                SampleOAuth2Provider.generateAccessAndRefreshToken(accessor);
                String redirect_uri = request.getParameter(OAuth2.REDIRECT_URI);
                String state = request.getParameter(OAuth2.STATE);
               
                List<Parameter> list = new ArrayList<Parameter>(5);
                list.add(new Parameter(OAuth2.ACCESS_TOKEN,accessor.accessToken));
                list.add(new Parameter(OAuth2.TOKEN_TYPE,accessor.tokenType));
                list.add(new Parameter(OAuth2.EXPIRES_IN,"3600"));
                if(accessor.scope!=null) list.add(new Parameter(OAuth2.SCOPE,accessor.scope));
                if(state != null){
                    list.add(new Parameter(OAuth2.STATE, state));
                }
               
                redirect_uri = OAuth2.addParametersAsFragment(redirect_uri,list);
                response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);
                response.setHeader("Location", OAuth2.decodePercent(redirect_uri));
View Full Code Here


            // test number of parameters
            if (firstParameters.size() == secondParameters.size())
            {
                for (int i = 0; i < firstParameters.size() && sameSignature; i++)
                {
                    final Parameter firstParameter = (Parameter)firstParameters.get(i);
                    final Parameter secondParameter = (Parameter)secondParameters.get(i);

                    // test each parameter's type
                    sameSignature =
                        isEqual(
                            firstParameter.getType(),
                            secondParameter.getType());
                }
            }
            else
            {
                sameSignature = false;
View Full Code Here

        Iterator iterator = this.metaObject.getOwnedParameters().iterator();

        boolean commaNeeded = false;
        while (iterator.hasNext())
        {
            Parameter parameter = (Parameter)iterator.next();

            if (!parameter.getDirection().equals(ParameterDirectionKind.RETURN_LITERAL))
            {
                if (commaNeeded)
                {
                    buffer.append(", ");
                }
                buffer.append(parameter.getName());
                commaNeeded = true;
            }
        }
        return buffer.toString();
    }
View Full Code Here

        Iterator iterator = this.metaObject.getOwnedParameters().iterator();

        boolean commaNeeded = false;
        while (iterator.hasNext())
        {
            Parameter parameter = (Parameter)iterator.next();

            if (!parameter.getDirection().equals(ParameterDirectionKind.RETURN_LITERAL))
            {
                if (commaNeeded)
                {
                    buffer.append(", ");
                }
View Full Code Here

            arguments,
            new Predicate()
            {
                public boolean evaluate(final Object object)
                {
                    Parameter p = (Parameter)object;
                    return !p.getDirection().equals(ParameterDirectionKind.RETURN_LITERAL) && !p.isException();
                }
            });
        return arguments;
    }
View Full Code Here

        return new BooleanExpression(new CharacterExpression(qs, mapping, te), OP_IN, expr);
    }
   
    public StatementText toStatementText(int mode)
    {
        StatementText st = super.toStatementText(mode);
        if( mode == ScalarExpression.FILTER )
        {
            st.append(booleanCondition,mode);
        }
        return st;
    }
View Full Code Here

        }
    }

    public StatementText toStatementText(int mode)
    {
        StatementText st = super.toStatementText(mode);
        if (mode == ScalarExpression.FILTER)
        {
            st.append(booleanCondition,mode);
        }
        return st;
    }
View Full Code Here

     */
    public PreparedStatement getStatementForQuery(QueryExpression qs, ObjectManager om, ManagedConnection conn,
            boolean updateLock, String resultSetType, String resultSetConcurrency)
    throws SQLException
    {
        StatementText text = qs.toStatementText(updateLock);
        SQLController sqlControl = getSQLController();

        // Generate the statement using the statement text
        PreparedStatement ps = sqlControl.getStatementForQuery(conn, text.toString(), resultSetType, resultSetConcurrency);

        boolean done = false;
        try
        {
            // Apply any parameter values for the statement
            text.setParameters(om, ps);
            done = true;
        }
        finally
        {
            if (!done)
View Full Code Here

     * query statement.
     * @return The ordering statement
     */
    protected StatementText generateOrderingStatement()
    {
        StatementText orderByStmt = null;
        if (orderingExpressions != null && orderingExpressions.length > 0)
        {
            orderByStmt = new StatementText();
            boolean needsSelect = ((RDBMSAdapter)storeMgr.getDatastoreAdapter()).includeOrderByColumnsInSelect();
            for (int i=0; i<orderingExpressions.length; ++i)
            {
                String orderExpr = "JPOXORDER" + i;
                if (i > 0)
                {
                    orderByStmt.append(',');
                }

                if (needsSelect && !hasAggregateExpression)
                {
                    // Order by the "JPOXORDER?" if we need them to be selected and it isn't an aggregate
                    orderByStmt.append(orderExpr);
                }
                else
                {
                    // Order by the "THIS.COLUMN" otherwise
                    orderByStmt.append(orderingExpressions[i].toStatementText(ScalarExpression.PROJECTION).toStatementString(ScalarExpression.PROJECTION));
                }

                if (orderingDirections[i])
                {
                    orderByStmt.append(" DESC");
                }
            }
        }
        return orderByStmt;
    }
View Full Code Here

     * </pre>
     * @return The StatementText for the DELETE
     **/
    public StatementText toDeleteStatementText()
    {
        StatementText stmtText = new StatementText("DELETE FROM ");
        stmtText.append(mainTableExpr.toString());

        // TODO This only works where the base query statement has no joins

        if (whereExpr != null)
        {
            stmtText.append(" WHERE ").append(
                whereExpr.toStatementText(ScalarExpression.FILTER), ScalarExpression.FILTER);
        }

        return stmtText;
    }
View Full Code Here

TOP

Related Classes of org.jpox.store.mapped.query.StatementText$Parameter

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.