Examples of QueryOperation


Examples of org.eclipse.persistence.internal.xr.QueryOperation

            XMLDescriptor descriptor = new XMLDescriptor();
            descriptor.setDefaultRootElement(SERVICE_NAMESPACE_PREFIX + ":" + op.getName() + "Response");
            descriptor.setNamespaceResolver(nr);
            descriptor.setJavaClass(opClass);
            if (op instanceof QueryOperation) {
                QueryOperation queryOperation = (QueryOperation)op;
                if (queryOperation.isSimpleXMLFormat()) {
                    XMLAnyObjectMapping mapping = new XMLAnyObjectMapping();
                    mapping.setUseXMLRoot(true);
                    mapping.setAttributeName("result");
                    mapping.setXPath(SERVICE_NAMESPACE_PREFIX + ":" + "result");
                    descriptor.addMapping(mapping);
                    mapping.initialize((AbstractSession)dbwsAdapter.getOXSession());
                }
                else if (queryOperation.isAttachment()) {
                    Attachment attachment = queryOperation.getResult().getAttachment();
                    XMLBinaryDataMapping mapping = new XMLBinaryDataMapping();
                    mapping.setAttributeName("result");
                    mapping.setXPath(SERVICE_NAMESPACE_PREFIX + ":" + "result");
                    mapping.setSwaRef(true);
                    mapping.setShouldInlineBinaryData(false);
                    mapping.setMimeType(attachment.getMimeType());
                    descriptor.addMapping(mapping);
                }
                else {
                    QName type = queryOperation.getResult().getType();
                    String localElement = type.getLocalPart();
                    // look for top-level complex types
                    Set<Map.Entry<String, ComplexType>> entrySet =
                        dbwsAdapter.getSchema().getTopLevelComplexTypes().entrySet();
                    for (Map.Entry<String, ComplexType> me : entrySet) {
                        if (me.getValue().getName().equals(type.getLocalPart())) {
                            localElement = me.getKey();
                            break;
                        }
                    }
                    XMLDescriptor typeDescriptor =
                        dbwsAdapter.getDescriptorsByQName().get(type);
                    if (typeDescriptor != null) {
                        if (queryOperation.isCollection()) {
                            XMLCompositeCollectionMapping mapping =
                                new XMLCompositeCollectionMapping();
                            mapping.setAttributeName("result");
                            mapping.setReferenceClass(typeDescriptor.getJavaClass());
                            mapping.useCollectionClass(ArrayList.class);
View Full Code Here

Examples of org.eclipse.persistence.internal.xr.QueryOperation

            XMLDescriptor descriptor = new XMLDescriptor();
            descriptor.setDefaultRootElement(SERVICE_NAMESPACE_PREFIX + ":" + op.getName() + "Response");
            descriptor.setNamespaceResolver(nr);
            descriptor.setJavaClass(opClass);
            if (op instanceof QueryOperation) {
                QueryOperation queryOperation = (QueryOperation)op;
                if (queryOperation.isSimpleXMLFormat()) {
                    XMLAnyObjectMapping mapping = new XMLAnyObjectMapping();
                    mapping.setUseXMLRoot(true);
                    mapping.setAttributeName("result");
                    mapping.setXPath(SERVICE_NAMESPACE_PREFIX + ":" + "result");
                    descriptor.addMapping(mapping);
                    mapping.initialize((AbstractSession)dbwsAdapter.getOXSession());
                }
                else if (queryOperation.isAttachment()) {
                    Attachment attachment = queryOperation.getResult().getAttachment();
                    XMLBinaryDataMapping mapping = new XMLBinaryDataMapping();
                    mapping.setAttributeName("result");
                    mapping.setXPath(SERVICE_NAMESPACE_PREFIX + ":" + "result");
                    mapping.setSwaRef(true);
                    mapping.setShouldInlineBinaryData(false);
                    mapping.setMimeType(attachment.getMimeType());
                    descriptor.addMapping(mapping);
                }
                else {
                    QName type = queryOperation.getResult().getType();
                    String localElement = type.getLocalPart();
                    // look for top-level complex types
                    Set<Map.Entry<String, ComplexType>> entrySet =
                        dbwsAdapter.getSchema().getTopLevelComplexTypes().entrySet();
                    for (Map.Entry<String, ComplexType> me : entrySet) {
                        if (me.getValue().getName().equals(type.getLocalPart())) {
                            localElement = me.getKey();
                            break;
                        }
                    }
                    XMLDescriptor typeDescriptor =
                        dbwsAdapter.getDescriptorsByQName().get(type);
                    if (typeDescriptor != null) {
                        if (queryOperation.isCollection()) {
                            XMLCompositeCollectionMapping mapping =
                                new XMLCompositeCollectionMapping();
                            mapping.setAttributeName("result");
                            mapping.setReferenceClass(typeDescriptor.getJavaClass());
                            mapping.useCollectionClass(ArrayList.class);
View Full Code Here

Examples of org.eclipse.persistence.internal.xr.QueryOperation

            XMLDescriptor descriptor = new XMLDescriptor();
            descriptor.setDefaultRootElement(SERVICE_NAMESPACE_PREFIX + ":" + op.getName() + "Response");
            descriptor.setNamespaceResolver(nr);
            descriptor.setJavaClass(opClass);
            if (op instanceof QueryOperation) {
                QueryOperation queryOperation = (QueryOperation)op;
                if (queryOperation.isSimpleXMLFormat()) {
                    XMLAnyObjectMapping mapping = new XMLAnyObjectMapping();
                    mapping.setUseXMLRoot(true);
                    mapping.setAttributeName("result");
                    mapping.setXPath(SERVICE_NAMESPACE_PREFIX + ":" + "result");
                    descriptor.addMapping(mapping);
                    mapping.initialize((AbstractSession)dbwsAdapter.getOXSession());
                }
                else if (queryOperation.isAttachment()) {
                    Attachment attachment = queryOperation.getResult().getAttachment();
                    XMLBinaryDataMapping mapping = new XMLBinaryDataMapping();
                    mapping.setAttributeName("result");
                    mapping.setXPath(SERVICE_NAMESPACE_PREFIX + ":" + "result");
                    mapping.setSwaRef(true);
                    mapping.setShouldInlineBinaryData(false);
                    mapping.setMimeType(attachment.getMimeType());
                    descriptor.addMapping(mapping);
                }
                else {
                    QName type = queryOperation.getResult().getType();
                    String localElement = type.getLocalPart();
                    // look for top-level complex types
                    Set<Map.Entry<String, ComplexType>> entrySet =
                        dbwsAdapter.getSchema().getTopLevelComplexTypes().entrySet();
                    for (Map.Entry<String, ComplexType> me : entrySet) {
                        if (me.getValue().getName().equals(type.getLocalPart())) {
                            localElement = me.getKey();
                            break;
                        }
                    }
                    XMLDescriptor typeDescriptor =
                        dbwsAdapter.getDescriptorsByQName().get(type);
                    if (typeDescriptor != null) {
                        if (queryOperation.isCollection()) {
                            XMLCompositeCollectionMapping mapping =
                                new XMLCompositeCollectionMapping();
                            mapping.setAttributeName("result");
                            mapping.setReferenceClass(typeDescriptor.getJavaClass());
                            mapping.useCollectionClass(ArrayList.class);
View Full Code Here

Examples of org.infinispan.client.hotrod.impl.operations.QueryOperation

   }

   private List<Object> executeQuery() {
      List<Object> results;

      QueryOperation op = cache.getOperationsFactory().newQueryOperation(this);
      QueryResponse response = op.execute();
      totalResults = (int) response.getTotalResults();
      if (response.getProjectionSize() > 0) {
         results = new ArrayList<Object>(response.getResults().size() / response.getProjectionSize());
         Iterator<WrappedMessage> it = response.getResults().iterator();
         while (it.hasNext()) {
View Full Code Here

Examples of org.infinispan.client.hotrod.impl.operations.QueryOperation

       }
       return Collections.unmodifiableSet(toReturn);
   }

   public List query(RemoteQuery remoteQuery) {
      QueryOperation op = operationsFactory.newQueryOperation(remoteQuery);
      QueryResponse response = op.execute();
      List<Object> results = new ArrayList<Object>(response.getNumResults());
      if (response.getProjectionSize() > 0) {
         Iterator<WrappedMessage> it = response.getResults().iterator();
         while (it.hasNext()) {
            Object[] row = new Object[response.getProjectionSize()];
View Full Code Here

Examples of org.infinispan.client.hotrod.impl.operations.QueryOperation

   }

   private List<Object> executeQuery() {
      List<Object> results;

      QueryOperation op = cache.getOperationsFactory().newQueryOperation(this);
      QueryResponse response = op.execute();
      numResults = response.getNumResults();
      if (response.getProjectionSize() > 0) {
         results = new ArrayList<Object>(response.getResults().size() / response.getProjectionSize());
         Iterator<WrappedMessage> it = response.getResults().iterator();
         while (it.hasNext()) {
View Full Code Here

Examples of org.infinispan.client.hotrod.impl.operations.QueryOperation

   }

   private List<Object> executeQuery() {
      List<Object> results;

      QueryOperation op = cache.getOperationsFactory().newQueryOperation(this);
      QueryResponse response = op.execute();
      totalResults = (int) response.getTotalResults();
      if (response.getProjectionSize() > 0) {
         results = new ArrayList<Object>(response.getResults().size() / response.getProjectionSize());
         Iterator<WrappedMessage> it = response.getResults().iterator();
         while (it.hasNext()) {
View Full Code Here

Examples of org.infinispan.client.hotrod.impl.operations.QueryOperation

   }

   private List<Object> executeQuery() {
      List<Object> results;

      QueryOperation op = cache.getOperationsFactory().newQueryOperation(this);
      QueryResponse response = op.execute();
      totalResults = (int) response.getTotalResults();
      if (response.getProjectionSize() > 0) {
         results = new ArrayList<Object>(response.getResults().size() / response.getProjectionSize());
         Iterator<WrappedMessage> it = response.getResults().iterator();
         while (it.hasNext()) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.