- step:
- 1. for loop traversal
list<Object>
- 2. Use the Object[] array to accept each Object object
- 3. Take the parameters in Object[] and put them into the entity object
- 4. Put the entity object into the list <entity class>
String sql = "SELECT * FROM department";
List<?> list = baseDao.findBySql(sql, 0, 0, null);
List<Department> departmentList = new ArrayList<Department>();
for (int i = 0; i < list.size(); i++) {
Object[] obj = (Object[]) list.get(i);
departmentList.add(new Department((Integer) obj[0], (String) obj[1]));
}
return departmentList;