Example usage for org.springframework.data.mongodb.core.mapping Location getId

List of usage examples for org.springframework.data.mongodb.core.mapping Location getId

Introduction

In this page you can find the example usage for org.springframework.data.mongodb.core.mapping Location getId.

Prototype

public ObjectId getId() 

Source Link

Usage

From source file:org.springframework.data.mongodb.core.mapping.MappingTests.java

@Test
public void testPrimitivesAndCustomCollectionName() {
    Location loc = new Location(new double[] { 1.0, 2.0 }, new int[] { 1, 2, 3, 4 },
            new float[] { 1.0f, 2.0f });
    template.insert(loc);/* w  ww  .  ja  v a 2s . c om*/

    List<Location> result = template.find(new Query(Criteria.where("_id").is(loc.getId())), Location.class,
            "places");
    assertThat(result.size(), is(1));
}