/** @see DATADOC-240, DATADOC-212 */ @Test public void updatesObjectIdsCorrectly() { PersonWithIdPropertyOfTypeObjectId person = new PersonWithIdPropertyOfTypeObjectId(); person.setId(new ObjectId()); person.setFirstName("Dave"); template.save(person); template.updateFirst( query(where("id").is(person.getId())), update("firstName", "Carter"), PersonWithIdPropertyOfTypeObjectId.class); PersonWithIdPropertyOfTypeObjectId result = template.findById(person.getId(), PersonWithIdPropertyOfTypeObjectId.class); assertThat(result, is(notNullValue())); assertThat(result.getId(), is(person.getId())); assertThat(result.getFirstName(), is("Carter")); }