Package org.eclipse.persistence.internal.jpa.parsing

Examples of org.eclipse.persistence.internal.jpa.parsing.JPQLParseTree


        DatabaseQuery databaseQuery = null;
        if (isCacheable) {
            databaseQuery = (DatabaseQuery)session.getProject().getJPQLParseCache().get(jpql);           
        }
        if ((databaseQuery == null) || (!databaseQuery.isPrepared())) {
            JPQLParseTree parseTree = JPQLParser.buildParseTree(queryName, jpql);
            parseTree.setClassLoader(classLoader);
            databaseQuery = parseTree.createDatabaseQuery();
            databaseQuery.setJPQLString(jpql);
            parseTree.populateQuery(databaseQuery, (AbstractSession)session);           
            // If the query uses fetch joins, need to use JPA default of not filtering duplicates.
            if (databaseQuery.isReadAllQuery()) {
                ReadAllQuery readAllQuery = (ReadAllQuery)databaseQuery;
                if (readAllQuery.hasJoining() && (readAllQuery.getDistinctState() == ReadAllQuery.DONT_USE_DISTINCT)) {
                    readAllQuery.setShouldFilterDuplicates(false);
                }
            }
            // Bug#4646580  Add arguments to query.
            parseTree.addParametersToQuery(databaseQuery);
            ((JPQLCallQueryMechanism)databaseQuery.getQueryMechanism()).getJPQLCall().setIsParsed(true);

            //GF#1324 eclipselink.refresh query hint does not cascade
            //cascade by mapping as default for read query
            if (databaseQuery.isReadQuery()) {
View Full Code Here


                    throw DescriptorException.additionalCriteriaNotSupportedWithInheritanceViews(getDescriptor());
                }
           
                String jpql = "select this from " + descriptor.getAlias() + " this where " + additionalCriteria.trim();
           
                JPQLParseTree parseTree = JPQLParser.buildParseTree(jpql);
                parseTree.setClassLoader(session.getLoader());
                DatabaseQuery databaseQuery = parseTree.createDatabaseQuery();
                databaseQuery.setJPQLString(jpql);
                parseTree.populateQuery(databaseQuery, (AbstractSession) session);
                parseTree.addParametersToQuery(databaseQuery);
           
                updatePropertyParameterExpression(databaseQuery.getSelectionCriteria());
                
                additionalJoinExpression = databaseQuery.getSelectionCriteria().and(additionalJoinExpression);
            }
View Full Code Here

        DatabaseQuery databaseQuery = null;
        if (isCacheable) {
            databaseQuery = (DatabaseQuery)session.getProject().getJPQLParseCache().get(jpql);           
        }
        if ((databaseQuery == null) || (!databaseQuery.isPrepared())) {
            JPQLParseTree parseTree = JPQLParser.buildParseTree(queryName, jpql);
            parseTree.setClassLoader(classLoader);
            databaseQuery = parseTree.createDatabaseQuery();
            databaseQuery.setJPQLString(jpql);
            parseTree.populateQuery(databaseQuery, (AbstractSession)session);           
            // If the query uses fetch joins, need to use JPA default of not filtering duplicates.
            if (databaseQuery.isReadAllQuery()) {
                ReadAllQuery readAllQuery = (ReadAllQuery)databaseQuery;
                if (readAllQuery.hasJoining() && (readAllQuery.getDistinctState() == ReadAllQuery.DONT_USE_DISTINCT)) {
                    readAllQuery.setShouldFilterDuplicates(false);
                }
            }
            // Bug#4646580  Add arguments to query.
            parseTree.addParametersToQuery(databaseQuery);
            ((JPQLCallQueryMechanism)databaseQuery.getQueryMechanism()).getJPQLCall().setIsParsed(true);
            databaseQuery.setFlushOnExecute(flushOnExecute);           

            //GF#1324 eclipselink.refresh query hint does not cascade
            //cascade by mapping as default for read query
View Full Code Here

        }
        if ((cachedQuery == null)
                || (!cachedQuery.isPrepared())
                || (cachedQuery.getClass() != query.getClass())) {
            JPQLParser parser = parseEJBQLString(jpqlString);
            JPQLParseTree parseTree = parser.getParseTree();
            parseTree.populateQuery(query, session);
            if (isCacheable) {
                session.getProject().getJPQLParseCache().put(jpqlString, query);
            }
        } else {
            query.prepareFromQuery(cachedQuery);
View Full Code Here

        DatabaseQuery databaseQuery = null;
        if (isCacheable) {
            databaseQuery = (DatabaseQuery)session.getProject().getJPQLParseCache().get(jpql);           
        }
        if ((databaseQuery == null) || (!databaseQuery.isPrepared())) {
            JPQLParseTree parseTree = JPQLParser.buildParseTree(queryName, jpql);
            parseTree.setClassLoader(classLoader);
            databaseQuery = parseTree.createDatabaseQuery();
            databaseQuery.setJPQLString(jpql);
            parseTree.populateQuery(databaseQuery, (AbstractSession)session);           
            // If the query uses fetch joins, need to use JPA default of not filtering duplicates.
            if (databaseQuery.isReadAllQuery()) {
                ReadAllQuery readAllQuery = (ReadAllQuery)databaseQuery;
                if (readAllQuery.hasJoining() && (readAllQuery.getDistinctState() == ReadAllQuery.DONT_USE_DISTINCT)) {
                    readAllQuery.setShouldFilterDuplicates(false);
                }
            }
            // Bug#4646580  Add arguments to query.
            parseTree.addParametersToQuery(databaseQuery);
            ((JPQLCallQueryMechanism)databaseQuery.getQueryMechanism()).getJPQLCall().setIsParsed(true);

            //GF#1324 eclipselink.refresh query hint does not cascade
            //cascade by mapping as default for read query
            if (databaseQuery.isReadQuery()) {
View Full Code Here

        DatabaseQuery databaseQuery = null;
        if (isCacheable) {
            databaseQuery = (DatabaseQuery) session.getProject().getJPQLParseCache().get(jpql);
        }
        if ((databaseQuery == null) || (!databaseQuery.isPrepared())) {
            JPQLParseTree parseTree = JPQLParser.buildParseTree(queryName, jpql);
            parseTree.setClassLoader(classLoader);
            databaseQuery = parseTree.createDatabaseQuery();
            databaseQuery.setJPQLString(jpql);
            parseTree.populateQuery(databaseQuery, (AbstractSession) session);
            // If the query uses fetch joins, need to use JPA default of not
            // filtering duplicates.
            if (databaseQuery.isReadAllQuery()) {
                ReadAllQuery readAllQuery = (ReadAllQuery) databaseQuery;
                if (readAllQuery.hasJoining() && (readAllQuery.getDistinctState() == ReadAllQuery.DONT_USE_DISTINCT)) {
                    readAllQuery.setShouldFilterDuplicates(false);
                }
            }
            // Bug#4646580 Add arguments to query.
            parseTree.addParametersToQuery(databaseQuery);

            ((JPQLCallQueryMechanism) databaseQuery.getQueryMechanism()).getJPQLCall().setIsParsed(true);

            // Apply the lock mode.
            if (lockMode != null && !lockMode.name().equals(ObjectLevelReadQuery.NONE)) {
View Full Code Here

                throw DescriptorException.additionalCriteriaNotSupportedWithInheritanceViews(getDescriptor());
            }
           
            String jpql = "select this from " + descriptor.getAlias() + " this where " + additionalCriteria.trim();
           
            JPQLParseTree parseTree = JPQLParser.buildParseTree(jpql);
            parseTree.setClassLoader(session.getLoader());
            DatabaseQuery databaseQuery = parseTree.createDatabaseQuery();
            databaseQuery.setJPQLString(jpql);
            parseTree.populateQuery(databaseQuery, (AbstractSession) session);
            parseTree.addParametersToQuery(databaseQuery);
           
            updatePropertyParameterExpression(databaseQuery.getSelectionCriteria());
                
            additionalJoinExpression = databaseQuery.getSelectionCriteria().and(additionalJoinExpression);
        }
View Full Code Here

                throw DescriptorException.additionalCriteriaNotSupportedWithInheritanceViews(getDescriptor());
            }
           
            String jpql = "select this from " + descriptor.getAlias() + " this where " + additionalCriteria.trim();
           
            JPQLParseTree parseTree = JPQLParser.buildParseTree(jpql);
            parseTree.setClassLoader(session.getLoader());
            DatabaseQuery databaseQuery = parseTree.createDatabaseQuery();
            databaseQuery.setJPQLString(jpql);
            parseTree.populateQuery(databaseQuery, (AbstractSession) session);
            parseTree.addParametersToQuery(databaseQuery);
           
            updatePropertyParameterExpression(databaseQuery.getSelectionCriteria());
                
            additionalJoinExpression = databaseQuery.getSelectionCriteria().and(additionalJoinExpression);
        }
View Full Code Here

        }
        if ((cachedQuery == null)
                || (!cachedQuery.isPrepared())
                || (cachedQuery.getClass() != query.getClass())) {
            JPQLParser parser = parseEJBQLString(jpqlString);
            JPQLParseTree parseTree = parser.getParseTree();
            parseTree.populateQuery(query, session);
            if (isCacheable) {
                session.getProject().getJPQLParseCache().put(jpqlString, query);
            }
        } else {
            query.prepareFromQuery(cachedQuery);
View Full Code Here

        DatabaseQuery databaseQuery = null;
        if (isCacheable) {
            databaseQuery = (DatabaseQuery) session.getProject().getJPQLParseCache().get(jpql);
        }
        if ((databaseQuery == null) || (!databaseQuery.isPrepared())) {
            JPQLParseTree parseTree = JPQLParser.buildParseTree(queryName, jpql);
            parseTree.setClassLoader(classLoader);
            databaseQuery = parseTree.createDatabaseQuery();
            databaseQuery.setJPQLString(jpql);
            parseTree.populateQuery(databaseQuery, (AbstractSession) session);
            // If the query uses fetch joins, need to use JPA default of not
            // filtering duplicates.
            if (databaseQuery.isReadAllQuery()) {
                ReadAllQuery readAllQuery = (ReadAllQuery) databaseQuery;
                if (readAllQuery.hasJoining() && (readAllQuery.getDistinctState() == ReadAllQuery.DONT_USE_DISTINCT)) {
                    readAllQuery.setShouldFilterDuplicates(false);
                }
            }
            // Bug#4646580 Add arguments to query.
            parseTree.addParametersToQuery(databaseQuery);
            ((JPQLCallQueryMechanism) databaseQuery.getQueryMechanism()).getJPQLCall().setIsParsed(true);

            // GF#1324 eclipselink.refresh query hint does not cascade
            // cascade by mapping as default for read query
            if (databaseQuery.isReadQuery()) {
View Full Code Here

TOP

Related Classes of org.eclipse.persistence.internal.jpa.parsing.JPQLParseTree

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.