Articles Tagged ‘mongodb’

Creating elegant, typesafe Queries for JPA, mongoDB/Morphia and Lucene using Querydsl

Thursday, February 13th, 2014

Querydsl is a framework that allows us to create elegant, type-safe queries for a variety of different data-sources like Java Persistence API (JPA) entities, Java Data Objects (JDO), mongoDB with Morphia, SQL, Hibernate Search up to Lucene.

In the following tutorial we’re implementing example queries for different environments – Java Persistence API compared with a JPQL and a criteria API query, mongoDB with Morphia and last but not least for Lucene.

(more…)

Writing Java Integration Tests for MongoDB

Wednesday, October 16th, 2013

MongoDB is matured, document-oriented, cross-platform NoSQL database system with drivers available for a bunch of different programming languages.

In the following short examples I’m going to write some integration tests for MongoDB using the MongoDB Java driver and the Flapdoodle library to create an embedded MongoDB instance for testing.

We’re going to write tests for a simple persist-and-query scenarion and for a map-reduce function and in addition I’m going to show how to bind the start and stop of a MongoDB  instance to a Maven goal using the embedmongo-maven-plugin.

(more…)

Search
Tags
Categories