lesson.setTeacherIds(Arrays.asList(rs.getString("teacherIds").split("")).stream().
map(Integer::parseInt).collect(Collectors.toList()));
1、首先将mysql中的text类型转成String数组:
rs.getString("teacherIds").split("")
2、将String数组转为List<Integer>:
Arrays.asList()
3、将List<String>转为List<Integer>:
Arrays.asList(rs.getString("teacherIds").split("")).stream().
map(Integer::parseInt).collect(Collectors.toList())