- 
                Notifications
    You must be signed in to change notification settings 
- Fork 3k
Fix MongoDB Panache projection #9407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| Looks OK, but I don't understand why the existing tests didn't show this, and why we don't need a new test to show we've fixed it? | 
| @FroMage I agree with you and I'm a little disturbed by the fact the our integration test worked as it is the same as the example that didn't works on the mailing list. I verify it with the example on the mailing list and it passes. Now, two options, dig inside the issue and try to understand it better ... or admit that computer science is part of the chaos theory and that we didn't understand everything and merge it ;) Anyway, this PR is the right implementation, it's just fustrating because it shouldn't have worked in the first place ... | 
| Are you sure the tests are run? | 
| @FroMage yes, I double checked via a good old sysout and it's called inside Which is more or less the same thing as what is reported as an issue ... | 
| Watch out that this code doesn't check the return type at all. Try:   @GET
    @Path("/search/{name}")
    public List<PersonName> searchPersons(@PathParam("name") String name) {
        List<PersonName> ret = personRepository.find("lastname", name).project(PersonName.class).list();
        PersonName p = ret.get(0); // this will throw if it's not the right type
        return ret;
    } | 
| @FroMage good catch! Generic type erasure is tricky! I'll add something in the test. | 
a8985cf    to
    7c4c281      
    Compare
  
    | I added a bunch of test code to be sure that the type is the correct one. | 
7c4c281    to
    fb60c67      
    Compare
  
    
No description provided.