protected Object getEntityFromFields(ResultSet rs, Class<?> resultClass, Map<String, String> resultMap) {
        Object obj = null;
        try {
            obj = resultClass.newInstance();
        } catch (Exception e) {
            e.printStackTrace();
        }

        for (String item : resultMap.keySet()) {
            String strSetMethod = "set" + resultMap.get(item).substring(0, 1).toUpperCase()
                    + resultMap.get(item).substring(1);
            String strGetMethod = "get" + resultMap.get(item).substring(0, 1).toUpperCase()
                    + resultMap.get(item).substring(1);
            try {

                Method mGet = resultClass.getMethod(strGetMethod);
                Class<?> type = mGet.getReturnType();
                if (type.equals(int.class) || type.equals(Integer.class)) {
                    Method mSet = resultClass.getMethod(strSetMethod, Integer.class);
                    mSet.invoke(obj, rs.getInt(item));
                } else if (type.equals(String.class)) {
                    Method mSet = resultClass.getMethod(strSetMethod, String.class);
                    mSet.invoke(obj, rs.getString(item));
                }

            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return obj;
    }