Use the Java reflection mechanism to call entity class get and set methods at one time to simplify more code.
why_su: I took a compromise method: because I passed the field name as a parameter, I did not call the set method and directly assigned a value to the field. [code=java] /** * Call the set method to assign values * * @param object object * @param fieldName fieldname * @param value */ private void invoke(Object object, String fieldName, String value) throws Exception { Class clazz = (); Field field = (fieldName); (true); (object, value); } [/code]