{"action":"created","issue":{"url":"https://api.github.com/repos/marklogic/java-client-api/issues/522","repository_url":"https://api.github.com/repos/marklogic/java-client-api","labels_url":"https://api.github.com/repos/marklogic/java-client-api/issues/522/labels{/name}","comments_url":"https://api.github.com/repos/marklogic/java-client-api/issues/522/comments","events_url":"https://api.github.com/repos/marklogic/java-client-api/issues/522/events","html_url":"https://github.com/marklogic/java-client-api/issues/522","id":186589422,"number":522,"title":"PojoQueryBuilderImpl wrapQueries","user":{"login":"malteseduck","id":367817,"avatar_url":"https://avatars.githubusercontent.com/u/367817?v=3","gravatar_id":"","url":"https://api.github.com/users/malteseduck","html_url":"https://github.com/malteseduck","followers_url":"https://api.github.com/users/malteseduck/followers","following_url":"https://api.github.com/users/malteseduck/following{/other_user}","gists_url":"https://api.github.com/users/malteseduck/gists{/gist_id}","starred_url":"https://api.github.com/users/malteseduck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malteseduck/subscriptions","organizations_url":"https://api.github.com/users/malteseduck/orgs","repos_url":"https://api.github.com/users/malteseduck/repos","events_url":"https://api.github.com/users/malteseduck/events{/privacy}","received_events_url":"https://api.github.com/users/malteseduck/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-11-01T17:07:57Z","updated_at":"2016-11-02T19:20:49Z","closed_at":null,"body":"In many of the methods for building queries for POJOs there is a check to see if `wrapQueries` is set to `true` before it prefixes path information, creates container queries, etc.  The`pojoPropertyPath()` method:\r\n\r\nhttps://github.com/marklogic/java-client-api/blob/develop/src/main/java/com/marklogic/client/impl/PojoQueryBuilderImpl.java#L53\r\n\r\ndoes not do a similar check.  Would something like this:\r\n\r\n```\r\n    private StructuredQueryBuilder.PathIndex pojoPropertyPath(String pojoProperty) {\r\n        if (wrapQueries) {\r\n            return pathIndex(classWrapper + \"/\" + pojoProperty);\r\n        } else {\r\n            return pathIndex(\"/\" + pojoProperty);\r\n        }\r\n    }\r\n```\r\n\r\nbe more appropriate to honor that `wrapQueries` state, or are there things that would break or other reasons it should not be implemented this way?"},"comment":{"url":"https://api.github.com/repos/marklogic/java-client-api/issues/comments/257971353","html_url":"https://github.com/marklogic/java-client-api/issues/522#issuecomment-257971353","issue_url":"https://api.github.com/repos/marklogic/java-client-api/issues/522","id":257971353,"user":{"login":"malteseduck","id":367817,"avatar_url":"https://avatars.githubusercontent.com/u/367817?v=3","gravatar_id":"","url":"https://api.github.com/users/malteseduck","html_url":"https://github.com/malteseduck","followers_url":"https://api.github.com/users/malteseduck/followers","following_url":"https://api.github.com/users/malteseduck/following{/other_user}","gists_url":"https://api.github.com/users/malteseduck/gists{/gist_id}","starred_url":"https://api.github.com/users/malteseduck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malteseduck/subscriptions","organizations_url":"https://api.github.com/users/malteseduck/orgs","repos_url":"https://api.github.com/users/malteseduck/repos","events_url":"https://api.github.com/users/malteseduck/events{/privacy}","received_events_url":"https://api.github.com/users/malteseduck/received_events","type":"User","site_admin":false},"created_at":"2016-11-02T19:20:49Z","updated_at":"2016-11-02T19:20:49Z","body":"Most POJOs I have designed have some sort of collection in it, that is just how it has worked out.  As I have never used the containerQueryBuilder() function I haven't had an issue, but I can see how supporting more complicated JSON models would be useful.  Then again, if people aren't complaining it may not be worth it, and I am fine without it at the moment because most of the queries I do are value queries and I can do container queries and value queries and that mostly works fine. \r\n\r\nWhat would be most useful for us is a little more configurability on how the JSON is stored in the database.  For us, just the ability to \"turn off\" the class wrappers was all we really needed, but we kind of had to \"hack\" to get it to work.  Being able to get at the object mapper inside the PojoRepository and having that used throughout, plus the ability to turn off \"wrapQueries\" is what we need.  Maybe in general this exposing more configuration would expose a bunch of problems and that might be why it might not be an option.  That is the main question I wanted to ask, the \"wrapQueries\" one I started with was just a step towards this."}}
{"actor":{"display_login":"malteseduck"}}