@Override
    protected DBRef asReference(Object constant) {
        Key<?> key = morphia.getMapper().getKey(constant);
        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