@Override
    protected DBRef asReferenceKey(Class<?> entity, Object id) {
        String collection = morphia.getMapper().getCollectionName(entity);
        Key<?> key = new Key<Object>(entity, collection, id);
        return morphia.getMapper().keyToDBRef(key);
    }
{@code MorphiaSerializer} extends {@link MongodbSerializer} with Morphia specific annotation handling

@author tiwe
querydsl-mongodb/src/main/java/com/querydsl/mongodb/morphia/MorphiaSerializer.java