public static <C> Map<String, Object> pojoToDocument(Object o, Class<C> clazz) {

		Map<String, Object> map = new HashMap<String, Object>();
		Class<? extends Object> rtCls = o.getClass();

		Field[] fields = rtCls.getDeclaredFields();
		try {
			for (int i = 0; i < fields.length; i++) {
				Field f = fields[i];
				String name = f.getName();
//				String methodName = "get" + name.substring(0, 1).toUpperCase()
//				+ name.substring(1, name.length());
				String methodName = "get" + name;
				Object value = rtCls.getMethod(methodName).invoke(o, new Object[] {});
				
				if (value instanceof Map) {
					pojoToDocument(o, clazz);
				}

				map.put(name, value);
			}
		} catch (IllegalArgumentException e) {
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		} catch (SecurityException e) {
			e.printStackTrace();
		} catch (InvocationTargetException e) {
			e.printStackTrace();
		} catch (NoSuchMethodException e) {
			e.printStackTrace();
		}

		return map;
	}