Morphia « mongodb « Java Database Q&A

1. Morphia and MongoDB - Modeling Something like Settings

I'm evaluating MongoDB and Morphia right now. How would I model something like 'settings', where there is only one 'record' (I'm not sure of the proper Mongo term to use). ...

2. Morphia/MongoDB: can't do getmore

I'm trying to iterate over all rows ("documents"?) in my MongoDB database using Morphia. Occasionally I get the following stacktrace:

com.mongodb.MongoInternalException: can't do getmore
    at com.mongodb.DBApiLayer$Result._advance(

3. Strategy for using Morphia to persist domain objects without adding unnecessary annotations to domain objects?

Hypothetically, lets say I have a domain object called Person. It looks like such:

public class Member {

    private final String firstName;
    private final String lastName;

4. Using Mongodb and Morphia

Hi has anyone have used Mongodb with Morphia. I have made a implementation however I am getting a lot of errors from my implementation following the link below; Can anyone share ...

5. Unit testing with MongoDB

My database of choice is MongoDB. I'm writing a data-layer API to abstract implementation details from client applications - that is, I'm essentially providing a single public interface (an object which ...

6. Morphia Generics - Not Possible?

I'm trying to save a List of Generics(M) through Mongo/Morphia. I get this error when I tried to save: Generic Typed Class not supported: = class java.lang.Object Does this mean ...

7. How to add indexes in mongoDB project with Morphia framework

i'm working on a gwt project, that uses mongoDB as database, and morphia framework to work with mongodb. I already finished the basic dao of my classes and now i want to ...

8. Is there a way to automate the generation of test data for MongoDB

I have a DTO being mapped to MongoDB using morphia. Is there any way of generating randomised test data for MongoDB (as per my DTO) without writing something in-house?

9. How to programmatically instantiate dynamically loaded class from values in a file?

I have basic knowledge of Java's reflection API - therefore, this is not only a question of how, it's a question of whether it's possible and whether I'm going about a ...

10. DAO and dependency injection, advice?

This is the first time im using the DAO pattern. From what I've read so far, implementing this pattern will help me seperate my calling code (controller) from any ...

11. How to call DAO without Factory?

As per my post here, I have the following DAO hierarchy:

public interface GenericDAO<T, K> {
    public K insert(T object);
    public void remove(K objectId);

12. morphia handle bad data

Let's say I have some json like this in mongo:

and a java class like this:
public class Example {
    Integer n;
This works (I know that the json should ...