private void readSingle(final DBObject dbObject, final MappedField mf, final Object entity, Class fieldType,
Reference refAnn, EntityCache cache, Mapper mapr) {
Class referenceObjClass = fieldType;
DBRef dbRef = (DBRef) mf.getDbObjectValue(dbObject);
if (dbRef != null) {
Object resolvedObject = null;
if (refAnn.lazy() && LazyFeatureDependencies.assertDependencyFullFilled()) {
if (exists(referenceObjClass, dbRef, cache, mapr)) {
resolvedObject = createOrReuseProxy(referenceObjClass, dbRef, cache, mapr);
} else {
if (!refAnn.ignoreMissing()) {
throw new MappingException("The reference(" + dbRef.toString() + ") could not be fetched for "
+ mf.getFullName());
}
}
} else {
resolvedObject = resolveObject(dbRef, mf, cache, mapr);