Package org.datanucleus.store.query

Examples of org.datanucleus.store.query.Query$SubqueryDefinition


                        queryString += " WHERE " + URLDecoder.decode(req.getQueryString(), "UTF-8");
                    }
                    try
                    {
                        api.getTransaction().begin();
                        Query query = api.newQuery("JDOQL", queryString);
                        List result = (List)query.execute();
                        JSONArray array = new JSONArray(result);
                        resp.getWriter().write(array.toString());
                        resp.setHeader("Content-Type", "application/json");
                        resp.setStatus(200);
                        api.getTransaction().commit();
View Full Code Here


                    queryString += " WHERE " + URLDecoder.decode(req.getQueryString(), "UTF-8");
                }
                try
                {
                    api.getTransaction().begin();
                    Query query = api.newQuery("JDOQL", queryString);
                    /* Object result = */query.execute();
                    resp.setStatus(200);
                    api.getTransaction().commit();
                }
                finally
                {
View Full Code Here

        if (subqueryAliases != null)
        {
            for (int i=0;i<subqueryAliases.length;i++)
            {
                // Evaluate subquery first
                Query subquery = query.getSubqueryForVariable(subqueryAliases[i]).getQuery();
                QueryCompilation subqueryCompilation =
                    compilation.getCompilationForSubquery(subqueryAliases[i]);
                if (subqueryCompilation.getExprFrom() != null)
                {
                    // TODO Evaluate "from"
View Full Code Here

                            }

                            String subqueryStr = content.substring(i+1, endPosition).trim();
                            String subqueryVarName = "DATANUCLEUS_SUBQUERY_" + subqueryNum;

                            Query subquery = (Query)ClassUtils.newInstance(query.getClass(),
                                new Class[]{ExecutionContext.class, String.class},
                                new Object[] {query.getExecutionContext(), subqueryStr});
                            // TODO Set the type of the variable
                            query.addSubquery(subquery, "double " + subqueryVarName, null, null);
View Full Code Here

                            }

                            String subqueryStr = content.substring(i+1, endPosition).trim();
                            String subqueryVarName = "DATANUCLEUS_SUBQUERY_" + subqueryNum;

                            Query subquery = (Query)ClassUtils.newInstance(query.getClass(),
                                new Class[]{ExecutionContext.class, String.class},
                                new Object[] {query.getExecutionContext(), subqueryStr});
                            // TODO Set the type of the variable
                            query.addSubquery(subquery, "double " + subqueryVarName, null, null);
View Full Code Here

     * @return The internal DataNucleus query
     */
    protected Query getInternalQuery()
    {
        // Create a DataNucleus query and set the generic compilation
        Query internalQuery =
            ec.getStoreManager().getQueryManager().newQuery("JDOQL", ec, toString());
        internalQuery.setIgnoreCache(ignoreCache);
        if (!subclasses)
        {
            internalQuery.setSubclasses(false);
        }
        if (type == QueryType.SELECT)
        {
            if (resultDistinct != null)
            {
                internalQuery.setResultDistinct(resultDistinct.booleanValue());
            }
            internalQuery.setResultClass(resultClass);
            internalQuery.setUnique(unique);
        }
        if (extensions != null)
        {
            internalQuery.setExtensions(extensions);
        }
        if (fp != null)
        {
            internalQuery.setFetchPlan(((JDOFetchPlan)fp).getInternalFetchPlan());
        }
        if (type == QueryType.SELECT)
        {
            if (candidates != null)
            {
                internalQuery.setCandidates(candidates);
            }
        }

        QueryCompilation compilation = getCompilation();
        internalQuery.setCompilation(compilation);

        return internalQuery;
    }
View Full Code Here

        updateVals = null;
        unique = false;

        try
        {
            Query internalQuery = getInternalQuery();
            if (parameterValuesByName != null || parameterExprByName != null)
            {
                validateParameters();

                return internalQuery.deletePersistentAll(parameterValuesByName);
            }
            else
            {
                return internalQuery.deletePersistentAll();
            }
        }
        catch (NucleusException jpe)
        {
            // Convert any exceptions into what JDO expects
View Full Code Here

        if (internalQueries != null)
        {
            Iterator<Query> iter = internalQueries.iterator();
            while (iter.hasNext())
            {
                Query query = iter.next();
                query.close(result);
            }
        }
    }
View Full Code Here

        if (internalQueries != null)
        {
            Iterator<Query> iter = internalQueries.iterator();
            while (iter.hasNext())
            {
                Query query = iter.next();
                query.closeAll();
            }
            internalQueries.clear();
            internalQueries = null;
        }
    }
View Full Code Here

        if (subqueryAliases != null)
        {
            for (int i=0;i<subqueryAliases.length;i++)
            {
                // Evaluate subquery first
                Query subquery = query.getSubqueryForVariable(subqueryAliases[i]).getQuery();
                QueryCompilation subqueryCompilation =
                    compilation.getCompilationForSubquery(subqueryAliases[i]);
                Collection subqueryResult = evaluateSubquery(subquery, executeCandidates, subqueryCompilation);

                if (QueryUtils.queryReturnsSingleRow(subquery))
View Full Code Here

TOP

Related Classes of org.datanucleus.store.query.Query$SubqueryDefinition

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.