{"action":"created","issue":{"url":"https://api.github.com/repos/querydsl/querydsl/issues/1577","labels_url":"https://api.github.com/repos/querydsl/querydsl/issues/1577/labels{/name}","comments_url":"https://api.github.com/repos/querydsl/querydsl/issues/1577/comments","events_url":"https://api.github.com/repos/querydsl/querydsl/issues/1577/events","html_url":"https://github.com/querydsl/querydsl/issues/1577","id":107820665,"number":1577,"title":"Path visitor doesn't work for MongoDB queries when having subtype","user":{"login":"ulisesbocchio","id":457225,"avatar_url":"https://avatars.githubusercontent.com/u/457225?v=3","gravatar_id":"","url":"https://api.github.com/users/ulisesbocchio","html_url":"https://github.com/ulisesbocchio","followers_url":"https://api.github.com/users/ulisesbocchio/followers","following_url":"https://api.github.com/users/ulisesbocchio/following{/other_user}","gists_url":"https://api.github.com/users/ulisesbocchio/gists{/gist_id}","starred_url":"https://api.github.com/users/ulisesbocchio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ulisesbocchio/subscriptions","organizations_url":"https://api.github.com/users/ulisesbocchio/orgs","repos_url":"https://api.github.com/users/ulisesbocchio/repos","events_url":"https://api.github.com/users/ulisesbocchio/events{/privacy}","received_events_url":"https://api.github.com/users/ulisesbocchio/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/querydsl/querydsl/labels/progress","name":"progress","color":"d7e102"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-22T23:09:06Z","updated_at":"2015-09-23T18:41:01Z","closed_at":null,"body":"Consider the classes:\r\n\r\n```\r\n@Entity\r\nclass A {\r\n    @Embedded\r\n    private B b;\r\n}\r\n\r\nabstract class B {\r\n}\r\n\r\nclass B1 extends B {\r\n    private String name;\r\n}\r\n\r\nclass B2 extends B {\r\n    private String key;\r\n}\r\n\r\n```\r\nWhen I generate query DSL classes for this hierarchy I'm able to write expressions like this:\r\n`QA.a.b.as(QB1.class).name.eq(\"someName\")` or `QA.a.b.as(QB2.class).key.eq(\"someKey\")`\r\n\r\nbut the paths generated by MongodbSerializer for this expressions are wrong. In version 3.6.7 I just get \"name\" and \"key\", when they should be \"b.name\" and \"b.key\" respectively.\r\n\r\nI also tried this in version 3.6.5 after I saw this issue: https://github.com/querydsl/querydsl/issues/1427 but the results are weird, I get: \"b.a.b.name\"\r\n\r\non method `String visit(Path<?> expr, Void context)` of `MongodbSerializer` I can see how the recursion is avoided if the path type is DELEGATE which is not the case in this scenario, but even if the recursion was reached I'm not sure it'd still generate the right path. \r\n\r\nAny help would be greatly appreciated.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/querydsl/querydsl/issues/comments/142692613","html_url":"https://github.com/querydsl/querydsl/issues/1577#issuecomment-142692613","issue_url":"https://api.github.com/repos/querydsl/querydsl/issues/1577","id":142692613,"user":{"login":"timowest","id":574167,"avatar_url":"https://avatars.githubusercontent.com/u/574167?v=3","gravatar_id":"","url":"https://api.github.com/users/timowest","html_url":"https://github.com/timowest","followers_url":"https://api.github.com/users/timowest/followers","following_url":"https://api.github.com/users/timowest/following{/other_user}","gists_url":"https://api.github.com/users/timowest/gists{/gist_id}","starred_url":"https://api.github.com/users/timowest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timowest/subscriptions","organizations_url":"https://api.github.com/users/timowest/orgs","repos_url":"https://api.github.com/users/timowest/repos","events_url":"https://api.github.com/users/timowest/events{/privacy}","received_events_url":"https://api.github.com/users/timowest/received_events","type":"User","site_admin":false},"created_at":"2015-09-23T18:41:01Z","updated_at":"2015-09-23T18:41:01Z","body":"Thanks for the bug report! Fixed in the linked PR."}}