Error querying database. Cause: java.lang.UnsupportedOperationException

created at 06-09-2022 views: 13

error

2022-06-04 16:09:53.255 ERROR 8940 --- [nio-8081-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 
### Error querying database.  Cause: java.lang.UnsupportedOperationException
### The error may exist in file [F:\project\eyesblog\code\status\target\classes\mapper\HandleMapper.xml]
### The error may involve com.work.status.mapper.HandleMapper.getHandleInfo
### The error occurred while handling results
### SQL: select h.id, h.uid, s.name, s.gender, cl.name as className, m.name as major, co.name as college, h.type, h.handle_name, h.handle_result         from handle h, student s, class cl, major m, college co          WHERE h.uid = ?                 and s.id = h.uid                 and s.class_id = cl.id                 and cl.major_id = m.id                 and m.college_id = co.id                                           and h.type = ?
### Cause: java.lang.UnsupportedOperationException] with root cause

reason

In mybatis, the type of resultType should be the type that returns a single element in the collection. I wrote list directly, so I reported an error, so I changed resultType to the type that returns a single element in the collection or map or the like That's it.

created at:06-09-2022
edited at: 06-09-2022: