-
Notifications
You must be signed in to change notification settings - Fork 727
@JestId annotated variable not set if id field is not in the source data #142
Comments
Found the same problem. Most likely caused by the 'special' treatment of singular objects as opposed to list of objects in JestResult.extractSource(). |
Reproduction steps please. |
Sorry, currently very short on time and my environment is gone. —Reply to this email directly or view it on GitHub. |
@kramer Ok, debugged the setup again and what can I say - You are absolutely and completely correct. The Get-response is handled on line 160 and there the _id is not added to the source object. How should we proceed? I can do another fix + pull request. |
Just to clear things: Check out the test case @tomsen-san As a fix we need to duplicate line 154 right after line 160 (using variable |
I updated my fork, did the changes and did a pull request. The build fails though :-( Couldn't figure out from the log what is wrong. @kramer Maybe you could have a look and suggest fixes? |
@tomsen-san It's ok there is a sporadically failing test case that doesn't like Travis' build environment and it passes after a few tries, need to take a look into that sometime... Will merge your PR soon. |
:-) |
Closing as fixed by #174 |
For a POJO with one of the fields which annotated with @JestId, the getSourceAsObject throws a NullPointerException.
Unhandled exception occurred while converting source to the object . While saving the document the field annotated with @JestId is not set.
Looks related to ES_METADATA_ID which is not being set on the source.
The text was updated successfully, but these errors were encountered: