Package org.eclipse.persistence.jpa.rs.util.list

Examples of org.eclipse.persistence.jpa.rs.util.list.SingleResultQueryList


                // one or more fields in the MultiResultQueryListItem might be a domain object,
                // so, we need to set the relationshipInfo for those domain objects.
                setRelationshipInfo(fields.get(i).getValue());
            }
        } else if (entity instanceof SingleResultQueryList) {
            SingleResultQueryList item = (SingleResultQueryList) entity;
            List<JAXBElement> fields = item.getFields();
            for (int i = 0; i < fields.size(); i++) {
                // one or more fields in the SingleResultQueryList might be a domain object,
                // so, we need to set the relationshipInfo for those domain objects.
                setRelationshipInfo(fields.get(i).getValue());
            }
        } else if (entity instanceof MultiResultQueryList) {
            MultiResultQueryList list = (MultiResultQueryList) entity;
            List<MultiResultQueryListItem> items = list.getItems();
            for (int i = 0; i < items.size(); i++) {
                MultiResultQueryListItem item = items.get(i);
                List<JAXBElement> fields = item.getFields();
                for (int index = 0; index < fields.size(); index++) {
                    // one or more fields in the MultiResultQueryList might be a domain object,
                    // so, we need to set the relationshipInfo for those domain objects.
                    setRelationshipInfo(fields.get(index).getValue());
                }
View Full Code Here


                // one or more fields in the MultiResultQueryListItem might be a domain object,
                // so, we need to set the relationshipInfo for those domain objects.
                setRelationshipInfo(fields.get(i).getValue());
            }
        } else if (entity instanceof SingleResultQueryList) {
            SingleResultQueryList item = (SingleResultQueryList) entity;
            List<JAXBElement> fields = item.getFields();
            for (int i = 0; i < fields.size(); i++) {
                // one or more fields in the SingleResultQueryList might be a domain object,
                // so, we need to set the relationshipInfo for those domain objects.
                setRelationshipInfo(fields.get(i).getValue());
            }
        } else if (entity instanceof MultiResultQueryList) {
            MultiResultQueryList list = (MultiResultQueryList) entity;
            List<MultiResultQueryListItem> items = list.getItems();
            for (int i = 0; i < items.size(); i++) {
                MultiResultQueryListItem item = items.get(i);
                List<JAXBElement> fields = item.getFields();
                for (int index = 0; index < fields.size(); index++) {
                    // one or more fields in the MultiResultQueryList might be a domain object,
                    // so, we need to set the relationshipInfo for those domain objects.
                    setRelationshipInfo(fields.get(index).getValue());
                }
View Full Code Here

        Query query = app.buildQuery(getMatrixParameters(ui, persistenceUnit), name, getMatrixParameters(ui, name), getQueryParameters(ui));
        DatabaseQuery dbQuery = ((EJBQueryImpl<?>) query).getDatabaseQuery();
        if (dbQuery instanceof ReportQuery) {
            List<ReportItem> reportItems = ((ReportQuery) dbQuery).getItems();
            Object queryResults = query.getSingleResult();
            SingleResultQueryList list = populateReportQueryResponse(queryResults, reportItems);
            if (list != null) {
                List<JAXBElement> item = list.getFields();
                if ((item != null) && (item.size() == 1)) {
                    // Fix for Bug 393320 - JPA-RS: Respect the Accept Header for a singleResultQuery
                    // If there is only one item in the select clause and if value of that item is binary, we will create a response with
                    // that binary data without converting its to Base64.
                    JAXBElement element = item.get(0);
View Full Code Here

        return Response.ok(new StreamingOutputMarshaller(app, queryResults, hh.getAcceptableMediaTypes())).build();
    }

    @SuppressWarnings({ "rawtypes" })
    private SingleResultQueryList populateReportQueryResponse(Object result, List<ReportItem> reportItems) {
        SingleResultQueryList response = new SingleResultQueryList();
        List<JAXBElement> fields = createShellJAXBElementList(reportItems, result);
        if (fields == null) {
            return null;
        }
        response.setFields(fields);
        return response;
    }
View Full Code Here

                // one or more fields in the MultiResultQueryListItem might be a domain object,
                // so, we need to set the relationshipInfo for those domain objects.
                setRelationshipInfo(fields.get(i).getValue());
            }
        } else if (entity instanceof SingleResultQueryList) {
            SingleResultQueryList item = (SingleResultQueryList) entity;
            List<JAXBElement> fields = item.getFields();
            for (int i = 0; i < fields.size(); i++) {
                // one or more fields in the SingleResultQueryList might be a domain object,
                // so, we need to set the relationshipInfo for those domain objects.
                setRelationshipInfo(fields.get(i).getValue());
            }
        } else if (entity instanceof ReportQueryResultList) {
            ReportQueryResultList list = (ReportQueryResultList) entity;
            List<ReportQueryResultListItem> items = list.getItems();
            for (int i = 0; i < items.size(); i++) {
                ReportQueryResultListItem item = items.get(i);
                List<JAXBElement> fields = item.getFields();
                for (int index = 0; index < fields.size(); index++) {
                    // one or more fields in the MultiResultQueryList might be a domain object,
                    // so, we need to set the relationshipInfo for those domain objects.
                    setRelationshipInfo(fields.get(index).getValue());
                }
View Full Code Here

                // one or more fields in the MultiResultQueryListItem might be a domain object,
                // so, we need to set the relationshipInfo for those domain objects.
                setRelationshipInfo(field.getValue());
            }
        } else if (entity instanceof SingleResultQueryList) {
            SingleResultQueryList item = (SingleResultQueryList) entity;
            for (JAXBElement field : item.getFields()) {
                // one or more fields in the SingleResultQueryList might be a domain object,
                // so, we need to set the relationshipInfo for those domain objects.
                setRelationshipInfo(field.getValue());
            }
        } else if (entity instanceof ReportQueryResultList) {
            ReportQueryResultList list = (ReportQueryResultList) entity;
            for (ReportQueryResultListItem item : list.getItems()) {
                for (JAXBElement field : item.getFields()) {
                    // one or more fields in the MultiResultQueryList might be a domain object,
                    // so, we need to set the relationshipInfo for those domain objects.
                    setRelationshipInfo(field.getValue());
                }
            }
View Full Code Here

            Query query = context.buildQuery(getMatrixParameters(uriInfo, persistenceUnit), queryName, getMatrixParameters(uriInfo, queryName), getQueryParameters(uriInfo));
            DatabaseQuery dbQuery = ((EJBQueryImpl<?>) query).getDatabaseQuery();
            if (dbQuery instanceof ReportQuery) {
                List<ReportItem> reportItems = ((ReportQuery) dbQuery).getItems();
                Object queryResults = query.getSingleResult();
                SingleResultQueryList list = populateReportQueryResponse(queryResults, reportItems);
                if (list != null) {
                    List<JAXBElement> item = list.getFields();
                    if ((item != null) && (item.size() == 1)) {
                        // Fix for Bug 393320 - JPA-RS: Respect the Accept Header for a singleResultQuery
                        // If there is only one item in the select clause and if value of that item is binary, we will create a response with
                        // that binary data without converting its to Base64.
                        JAXBElement element = item.get(0);
View Full Code Here

        }
    }

    @SuppressWarnings({ "rawtypes" })
    private SingleResultQueryList populateReportQueryResponse(Object result, List<ReportItem> reportItems) {
        SingleResultQueryList response = new SingleResultQueryList();
        List<JAXBElement> fields = new FeatureResponseBuilderImpl().createShellJAXBElementList(reportItems, result);
        if (fields == null) {
            return null;
        }
        response.setFields(fields);
        return response;
    }
View Full Code Here

                // one or more fields in the MultiResultQueryListItem might be a domain object,
                // so, we need to set the relationshipInfo for those domain objects.
                setRelationshipInfo(fields.get(i).getValue());
            }
        } else if (entity instanceof SingleResultQueryList) {
            SingleResultQueryList item = (SingleResultQueryList) entity;
            List<JAXBElement> fields = item.getFields();
            for (int i = 0; i < fields.size(); i++) {
                // one or more fields in the SingleResultQueryList might be a domain object,
                // so, we need to set the relationshipInfo for those domain objects.
                setRelationshipInfo(fields.get(i).getValue());
            }
        } else if (entity instanceof MultiResultQueryList) {
            MultiResultQueryList list = (MultiResultQueryList) entity;
            List<MultiResultQueryListItem> items = list.getItems();
            for (int i = 0; i < items.size(); i++) {
                MultiResultQueryListItem item = items.get(i);
                List<JAXBElement> fields = item.getFields();
                for (int index = 0; index < fields.size(); index++) {
                    // one or more fields in the MultiResultQueryList might be a domain object,
                    // so, we need to set the relationshipInfo for those domain objects.
                    setRelationshipInfo(fields.get(index).getValue());
                }
View Full Code Here

        Query query = app.buildQuery(getMatrixParameters(ui, persistenceUnit), name, getMatrixParameters(ui, name), getQueryParameters(ui));
        DatabaseQuery dbQuery = ((EJBQueryImpl<?>) query).getDatabaseQuery();
        if (dbQuery instanceof ReportQuery) {
            List<ReportItem> reportItems = ((ReportQuery) dbQuery).getItems();
            Object queryResults = query.getSingleResult();
            SingleResultQueryList list = populateReportQueryResponse(queryResults, reportItems);
            if (list != null) {
                List<JAXBElement> item = list.getFields();
                if ((item != null) && (item.size() == 1)) {
                    // Fix for Bug 393320 - JPA-RS: Respect the Accept Header for a singleResultQuery
                    // If there is only one item in the select clause and if value of that item is binary, we will create a response with
                    // that binary data without converting its to Base64.
                    JAXBElement element = item.get(0);
View Full Code Here

TOP

Related Classes of org.eclipse.persistence.jpa.rs.util.list.SingleResultQueryList

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.