code: private static Object getObjectFromDocument(Metamodel metamodel, Map<String, Object> documentObj,
              Set<Attribute> columns, Object obj) throws InstantiationException, IllegalAccessException
      {
          for (Attribute column : columns)
          {
              Object value = documentObj.get(((AbstractAttribute) column).getJPAColumnName());
  
              if (((MetamodelImpl) metamodel).isEmbeddable(((AbstractAttribute) column).getBindableJavaType()))
              {
                  onViaEmbeddable(column, obj, metamodel, (Map<String, Object>) value);
              }
              else
              {
                  setFieldValue(obj, value, column);
              }
          }
          return obj;
      }
docs: Creates an instance of <code>clazz</code> and populates fields fetched
  from MongoDB document object. Field names are determined from
  <code>columns</code>
  
  @param documentObj
  the document obj
  @param clazz
  the clazz
  @param columns
  the columns
  @return the object from document
  @throws IllegalAccessException
  @throws InstantiationException