List of usage examples for org.springframework.data.mongodb.core.mapping PersonWithLongDBRef getPersonPojoLongId
public PersonPojoLongId getPersonPojoLongId()
From source file:org.springframework.data.mongodb.core.mapping.MappingTests.java
@Test public void testPersonWithLongDBRef() { PersonPojoLongId personPojoLongId = new PersonPojoLongId(12L, "PersonWithLongDBRef"); template.insert(personPojoLongId);//from w ww . ja v a 2 s . c om PersonWithLongDBRef personWithLongDBRef = new PersonWithLongDBRef(21, "PersonWith", "LongDBRef", personPojoLongId); template.insert(personWithLongDBRef); Query q = query(where("ssn").is(21)); PersonWithLongDBRef p2 = template.findOne(q, PersonWithLongDBRef.class); assertNotNull(p2); assertNotNull(p2.getPersonPojoLongId()); assertEquals(12L, p2.getPersonPojoLongId().getId()); }