There is such a problem when upgrading the previous project today
### Error querying database. Cause: java.lang.NullPointerException ### The error may exist in file [/Users/xxxx/IDEA-Pr/Hire/UserInformation/target/classes/mapper/EmployeeDao.xml] ### The error may involve com.app.hire.dao.EmployeeDao.selectEmployee ### The error occurred while handling results ### SQL: select e.user_id, e.name, e.age, e.sex, e.employee_desc, e.create_time, e.last_edit_time, e.phone, e.address, e.image, a.area_id, a.area_name, a.area_desc from tb_area a,tb_employee e where a.area_id=e.area_id and e.user_id=? ### Cause: java.lang.NullPointerException] with root cause
The wrong information as like as two peas in the mapper file, I ran the code that didn’t upgrade. The result is the same code. It can’t be used here. The springboot version of the previous code is 2.3.7.RELEASE. The current version is 2.2.2.RELEASE
after two hours of crazy inquiries. Finally, the problem is found
in our mapper file, if you want to perform a joint query, you will write a resultmap to put the query results. The class to be jointly queried has an attribute javatype. Set the real class of the object as shown in the figure below
but it is strange that my previous version can run without this javatype, As a result, the version has been reduced, but it can’t run. Do you have a boss to help answer the reason?Is it because the springboot version has been upgraded?
Conclusion: when writing resulmap, you’d better add javatype, otherwise there’s no place to find such errors.
- SQL error: 17006, sqlstate: 99999 invalid column name
- Springboot integrated with mybatis
- Mysql reports an error Operand should contain 1 column(s)
- [Solved] org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.zyh.springboot.
- CRM related SQL statements
- [solved] closingontransa ctionalSqlSessionorg.apache.ibatis . session.defaults.DefaultSqlSession @20] No information after that.
- Solve the problem that springboot does not scan @ repository
- How to Solve mybatis returns null when querying Oracle database with char type field
- Springboot error: property ‘sqlsessionfactory’ or ‘sqlsessiontemplate’ are required error details
- MySQL error operation should contain 1 column (s)
- Field xxxMapper in com.xxx.service.impl.xxxServiceImpl
- About ora-00257: archiver error. Connect internal only, until free
- How to call stored procedure in Hibernate
- Result Maps collection already contains value for com.xxx.xxxMapper . baseresultmap problem solving
- Error starting ApplicationContext. To display the conditions report re-run your application with ‘de
- 12 days after the programmer was dismissed by the company, the former leader asked to go back to the company to explain the code clearly, but he was confused
- Net Q & A: how to avoid the exception thrown by max() on emptyenumerable?
- Related configuration of mybatis project
- Simple license plate recognition based on Halcon
- java.lang.Error: Unresolved compilation problems