List of usage examples for org.springframework.data.mongodb.core.mapping PersonPojoIntId PersonPojoIntId
public PersonPojoIntId(int id, String text)
From source file:org.springframework.data.mongodb.core.mapping.MappingTests.java
@Test public void testNoMappingAnnotationsUsingIntAsId() { PersonPojoIntId p = new PersonPojoIntId(1, "Text"); template.insert(p);// w w w . j a v a 2 s. c om template.updateFirst(query(where("id").is(1)), update("text", "New Text"), PersonPojoIntId.class); PersonPojoIntId p2 = template.findOne(query(where("id").is(1)), PersonPojoIntId.class); assertEquals("New Text", p2.getText()); p.setText("Different Text"); template.save(p); PersonPojoIntId p3 = template.findOne(query(where("id").is(1)), PersonPojoIntId.class); assertEquals("Different Text", p3.getText()); }