Example usage for org.springframework.data.mongodb.core.mapping PrimitiveId setText

List of usage examples for org.springframework.data.mongodb.core.mapping PrimitiveId setText

Introduction

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

Prototype

public void setText(String text) 

Source Link

Usage

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

@Test
public void testPrimitivesAsIds() {
    PrimitiveId p = new PrimitiveId(1);
    p.setText("test text");

    template.save(p);/*  ww  w.  j  a  v  a2s . c  o  m*/

    PrimitiveId p2 = template.findOne(query(where("id").is(1)), PrimitiveId.class);
    assertNotNull(p2);
}