Example usage for org.springframework.data.mongodb.core.query CriteriaDefinition getCriteriaObject

List of usage examples for org.springframework.data.mongodb.core.query CriteriaDefinition getCriteriaObject

Introduction

In this page you can find the example usage for org.springframework.data.mongodb.core.query CriteriaDefinition getCriteriaObject.

Prototype

Document getCriteriaObject();

Source Link

Document

Get Document representation.

Usage

From source file:example.springdata.mongodb.util.ConsoleResultPrinter.java

public static void printResult(Collection<BlogPost> blogPosts, CriteriaDefinition criteria) {

    System.out.println(String.format("XXXXXXXXXXXX -- Found %s blogPosts matching '%s' --XXXXXXXXXXXX",
            blogPosts.size(), criteria != null ? criteria.getCriteriaObject() : ""));

    for (BlogPost blogPost : blogPosts) {
        System.out.println(blogPost);
    }/*from w  w  w. j a v a 2 s. c om*/

    System.out.println("XXXXXXXXXXXX -- XXXXXXXXXXXX -- XXXXXXXXXXXX\r\n");
}