Package org.xmldb.api.modules

Examples of org.xmldb.api.modules.XUpdateQueryService.update()


                } else if("update".equals(operation)) {
                    try {
                        XUpdateQueryService service =
                                (XUpdateQueryService) collection.getService("XUpdateQueryService", "1.0");
                        long count = (this.key == null)?
                                service.update(document) : service.updateResource(this.key, document);
                        message = count + " entries updated.";
                        result = "success";
                    } catch (XMLDBException e) {
                        message = "Failed to update resource " + key + ": " + e.errorCode;
                        getLogger().debug(message, e);
View Full Code Here


                "</person>";

        Collection col = this.client.getCollection(TEST_COLLECTION_PATH);
        XUpdateQueryService service = (XUpdateQueryService) col.getService("XUpdateQueryService", "1.0");

        long count = service.update(xupdate);
        assertEquals(1, count);

        String doc = this.client.getDocument(TEST_COLLECTION_PATH, "xupdatedoc");
        assertNotNull(doc);
        assertEquals(updatedDocument, doc);
View Full Code Here

           
            long result = 0;

            // See if we're updating one document or the whole collection.
            if (name == null) {
                result = service.update(commands.toString());
            }
            else {
                result = service.updateResource(name, commands.toString());
            }
               
View Full Code Here

          + "       480-300-3003"
          + "   </xu:update>"
          + "</xu:modifications>";

      XUpdateQueryService service = (XUpdateQueryService) collection.getService("XUpdateQueryService", "1.0");
      long count = service.update(xupdate);
      System.out.println(count + " entries updated.");
    }
    catch (XMLDBException e) {
      System.err.println("XML:DB Exception occured " + e.errorCode + " " + e.getMessage());
    }
View Full Code Here

                "</person>";

        Collection col = this.client.getCollection(TEST_COLLECTION_PATH);
        XUpdateQueryService service = (XUpdateQueryService) col.getService("XUpdateQueryService", "1.0");

        long count = service.update(query);
        assertEquals(6, count);

        String doc = this.client.getDocument(TEST_COLLECTION_PATH, "doc1");
        assertNotNull(doc);
        assertEquals(updatedDocument1, doc);
View Full Code Here

                } else if("update".equals(operation)) {
                    try {
                        XUpdateQueryService service =
                                (XUpdateQueryService) collection.getService("XUpdateQueryService", "1.0");
                        long count = (this.key == null)?
                                service.update(document) : service.updateResource(this.key, document);
                        message = count + " entries updated.";
                        result = "success";
                    } catch (XMLDBException e) {
                        message = "Failed to update resource " + key + ": " + e.errorCode;
                        getLogger().debug(message, e);
View Full Code Here

                "<phone type=\"work\">480-300-3003</phone>" +
                "</person>";

        Collection col = this.client.getCollection(TEST_COLLECTION_PATH);
        XUpdateQueryService service = (XUpdateQueryService) col.getService("XUpdateQueryService", "1.0");
        long count = service.update(query);
        // Bug #30878 fixed: was 6 should be 2. The old code would cause multiple updates.
        assertEquals(2, count);

        String doc = this.client.getDocument(TEST_COLLECTION_PATH, "doc1");
        assertNotNull(doc);
View Full Code Here

        doc = this.client.getDocument(TEST_COLLECTION_PATH, "doc2");
        assertNotNull(doc);
        XMLAssert.assertXMLEqual(updatedDocument2, doc);

        // test the second query should update 2 docs
        count = service.update(query2);
        assertEquals(2,count);

        // check the second doc to make sure its correct
        doc = this.client.getDocument(TEST_COLLECTION_PATH, "doc2");
View Full Code Here

                } else if("update".equals(operation)) {
                    try {
                        XUpdateQueryService service =
                                (XUpdateQueryService) collection.getService("XUpdateQueryService", "1.0");
                        long count = (this.key == null)?
                                service.update(document) : service.updateResource(this.key, document);
                        message = count + " entries updated.";
                        result = "success";
                    } catch (XMLDBException e) {
                        message = "Failed to update resource " + key + ": " + e.errorCode;
                        getLogger().debug(message, e);
View Full Code Here

                    } else if ("update".equals(operation)) {
                        try {
                            XUpdateQueryService service =
                                    (XUpdateQueryService) collection.getService("XUpdateQueryService", "1.0");
                            long count = (this.key == null)?
                                    service.update(document) : service.updateResource(this.key, document);
                            message = count + " entries updated.";
                            result = "success";
                        } catch (XMLDBException e) {
                            message = "Failed to update resource " + key + ": " + e.errorCode;
                            getLogger().debug(message, e);
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.