方式一
import org.springframework.cglib.beans.BeanMap; BeanMap.create(entityObj);
方式二
import com.alibaba.fastjson.JSONObject; //方式1、强转为JSONObject JSONObject xxx = (JSONObject) JSONObject.toJSON(xxxEntity); //方式2、转成json,在转为map String json = JSONObject.toJSONString(entityObj); Map map = JSONObject.parseObject(json, Map.class);