Package org.eclipse.persistence.jpa.rs.features

Examples of org.eclipse.persistence.jpa.rs.features.FeatureRequestValidator


            }

            FeatureSet featureSet = context.getSupportedFeatureSet();
            AbstractSession clientSession = context.getClientSession(em);
            if (featureSet.isSupported(Feature.PAGING)) {
                FeatureRequestValidator requestValidator = featureSet.getRequestValidator(Feature.PAGING);
                Map<String, Object> map = new HashMap<String, Object>();
                map.put(PagingRequestValidator.DB_QUERY, query);
                if (requestValidator.isRequested(uriInfo, null)) {
                    if (!requestValidator.isRequestValid(uriInfo, map)) {
                        throw JPARSException.invalidPagingRequest();
                    }
                    // check orderBy, and generate a warning if there is none
                    checkOrderBy(query);
                    result = clientSession.executeQuery(query, descriptor.getObjectBuilder().buildRow(entity, clientSession, WriteType.INSERT));
View Full Code Here


            Query query = context.buildQuery(getMatrixParameters(uriInfo, persistenceUnit), queryName, getMatrixParameters(uriInfo, queryName), getQueryParameters(uriInfo));
            DatabaseQuery dbQuery = ((EJBQueryImpl<?>) query).getDatabaseQuery();

            FeatureSet featureSet = context.getSupportedFeatureSet();
            if (featureSet.isSupported(Feature.PAGING)) {
                FeatureRequestValidator requestValidator = featureSet.getRequestValidator(Feature.PAGING);
                if (requestValidator.isRequested(uriInfo, null)) {
                    Map<String, Object> map = new HashMap<String, Object>();
                    map.put(PagingRequestValidator.DB_QUERY, dbQuery);
                    map.put(PagingRequestValidator.QUERY, query);
                    if (!requestValidator.isRequestValid(uriInfo, map)) {
                        // some query parameters for paging are invalid
                        throw JPARSException.invalidPagingRequest();
                    }
                    return namedQueryResponse(context, queryName, dbQuery, query, headers, uriInfo, featureSet.getResponseBuilder(Feature.PAGING));
                }
View Full Code Here

TOP

Related Classes of org.eclipse.persistence.jpa.rs.features.FeatureRequestValidator

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.