Example usage for org.springframework.data.mongodb.core MongoTemplate findById

List of usage examples for org.springframework.data.mongodb.core MongoTemplate findById

Introduction

In this page you can find the example usage for org.springframework.data.mongodb.core MongoTemplate findById.

Prototype

@Nullable
    @Override
    public <T> T findById(Object id, Class<T> entityClass) 

Source Link

Usage

From source file:fr.cirad.mgdb.exporting.individualoriented.PLinkExportHandler.java

/**
 * Gets the individual population.//from w ww. j av  a  2  s  .  c o m
 *
 * @param sModule the module
 * @param individual the individual
 * @return the individual population
 */
protected String getIndividualPopulation(final String sModule, final String individual) {
    MongoTemplate mongoTemplate = MongoTemplateManager.get(sModule);
    return mongoTemplate.findById(individual, Individual.class).getPopulation();
}