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

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. ...

February 13, 2014 · 9 min · 1879 words · Micha Kops

Writing Java Integration Tests for MongoDB

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. ...

October 16, 2013 · 8 min · 1585 words · Micha Kops