Package com.couchace.core.api.query

Examples of com.couchace.core.api.query.CouchJsonKey


        assertFalse(pageNavigation.hasPreviousPage());
        assertFalse(pageNavigation.hasNextPage());
        assertTrue(pageNavigation.hasRequestedPage());

        // http://127.0.0.1:5984/couch-test/_design/pet/_view/byTypeAndId?startkey=[%22DOG%22,%205]&endkey=[%22DOG%22,%207]
        viewQuery = CouchViewQuery.builder("pet", "byTypeAndId").limit(10).start(new CouchJsonKey("DOG", 5)).end(new CouchJsonKey("DOG", 7)).build();
        er = couchDatabase.get().entity(PetEntity.class, viewQuery).execute();
        pageNavigation = er.getCouchPageNavigation();
//    assertEquals(pageNavigation.requestedPage, "_design/pet/_view/byTypeAndId?include_docs=true&startkey=%5B%[%22DOG%22,%205]&endkey=%5B%[%22DOG%22,%207]&limit=10")
        assertEquals(er.getSize(), 3);
        foundPets = er.getEntityList();
View Full Code Here


                            JsonNode idNode = documentNode.get("id");
                            String id = (idNode != null) ? idNode.asText() : null;

                            // Key
                            JsonNode keyNode = documentNode.get("key");
                            CouchJsonKey jsonKey = (keyNode != null) ? new CouchJsonKey(keyNode.asText()) : new CouchJsonKey();

                            // Content may come from value or doc
                            JsonNode contentNode = documentNode.get("doc");
                            if (contentNode == null) {
                                contentNode = documentNode.get("value");
View Full Code Here

                entityDocumentList = new ArrayList<>();
                while (parser.nextToken() != null) {
                    String name = parser.getCurrentName();
                    parser.nextToken();
                    if ("rows".equals(name)) {
                        CouchJsonKey key = null;
                        while (parser.hasCurrentToken()) {
                            name = parser.getCurrentName();
                            if ("key".equals(name)) {
                                JsonToken token = parser.getCurrentToken();
                                if (token.isNumeric()) {
                                    key = new CouchJsonKey(parser.getNumberValue());
                                } else {
                                    key = new CouchJsonKey(parser.getText());
                                }
                            } else if ("value".equals(name)) {
                                // At this point we pass processing to the finalize methods - in many cases they will be parsing "doc" node
                                parser.nextToken();
View Full Code Here

                            JsonNode idNode = documentNode.get("id");
                            String id = (idNode != null) ? idNode.asText() : null;

                            // Key
                            JsonNode keyNode = documentNode.get("key");
                            CouchJsonKey jsonKey = (keyNode != null) ? new CouchJsonKey(keyNode.asText()) : new CouchJsonKey();

                            // Content may come from value or doc
                            JsonNode contentNode = documentNode.get("doc");
                            if (contentNode == null) {
                                contentNode = documentNode.get("value");
View Full Code Here

                entityDocumentList = new ArrayList<>();
                while (parser.nextToken() != null) {
                    String name = parser.getCurrentName();
                    parser.nextToken();
                    if ("rows".equals(name)) {
                        CouchJsonKey key = null;
                        while (parser.hasCurrentToken()) {
                            name = parser.getCurrentName();
                            if ("key".equals(name)) {
                                JsonToken token = parser.getCurrentToken();
                                if (token.isNumeric()) {
                                    key = new CouchJsonKey(parser.getNumberValue());
                                } else {
                                    key = new CouchJsonKey(parser.getText());
                                }
                            } else if ("value".equals(name)) {
                                // At this point we pass processing to the finalize methods - in many cases they will be parsing "doc" node
                                parser.nextToken();
View Full Code Here

                            JsonNode idNode = documentNode.get("id");
                            String id = (idNode != null) ? idNode.asText() : null;

                            // Key
                            JsonNode keyNode = documentNode.get("key");
                            CouchJsonKey jsonKey = (keyNode != null) ? new CouchJsonKey(keyNode.asText()) : new CouchJsonKey();

                            // Content may come from value or doc
                            JsonNode contentNode = documentNode.get("doc");
                            if (contentNode == null) {
                                contentNode = documentNode.get("value");
View Full Code Here

                entityDocumentList = new ArrayList<>();
                while (parser.nextToken() != null) {
                    String name = parser.getCurrentName();
                    parser.nextToken();
                    if ("rows".equals(name)) {
                        CouchJsonKey key = null;
                        while (parser.hasCurrentToken()) {
                            name = parser.getCurrentName();
                            if ("key".equals(name)) {
                                JsonToken token = parser.getCurrentToken();
                                if (token.isNumeric()) {
                                    key = new CouchJsonKey(parser.getNumberValue());
                                } else {
                                    key = new CouchJsonKey(parser.getText());
                                }
                            } else if ("value".equals(name)) {
                                // At this point we pass processing to the finalize methods - in many cases they will be parsing "doc" node
                                parser.nextToken();
View Full Code Here

TOP

Related Classes of com.couchace.core.api.query.CouchJsonKey

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.