
mybatis
北斗2018
努力,奋斗
展开
-
springboot项目中加入websocket服务端后,运行单元测试报错:javax.websocket.server.ServerContainer not available
解决办法:为SpringbootTest注解指定参数classes和webEnvironment,其中classes为启动类名称。@SpringBootTest(classes = OeeDemoApplication.class, webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)原创 2020-12-22 20:21:30 · 527 阅读 · 0 评论 -
Mybatis报错: Cause: java.sql.SQLSyntaxErrorException: Unknown column ‘shiftDate‘ in ‘where clause‘
错误详情:### The error occurred while setting parameters### SQL: select distinct device_code from item_loss_log where shift = ? and shiftDate = ?### Cause: java.sql.SQLSyntaxErrorException: Unknown column 'shiftDate' in 'where clause'这是个低级错误,查询字段拼写错误,将shi原创 2020-12-21 15:25:08 · 1280 阅读 · 0 评论 -
mybatis获取数据库连接时报错:The database URL cannot be null.
错误:The database URL cannot be null.通过javaconfig配置datasource时,要显式的设置url。如下: @Value("${spring.datasource.jdbc-url}") String url; @Value("${spring.datasource.username}") String username; @Value("${spring.datasource.password}") Str原创 2020-12-18 11:07:01 · 3842 阅读 · 0 评论 -
mybatis批量插入时报错:syntax error, expect ‘)‘
mybatis批量插入时报错:syntax error, expect ‘)’是因为传入的参数list为null,在代码中加上list.size()>0的判断。原创 2020-11-23 17:47:10 · 2432 阅读 · 1 评论 -
Mybatis封装的空指针异常
Mybatis报错:nested exception is org.apache.ibatis.builder.BuilderException: Error evaluating expression 'params.dataScope'. Cause: org.apache.ibatis.ognl.OgnlException: source is null for getProperty(null, "dataScope")。这个是mybatis对空指针异常的封装,要么检查参数是否为null,要么原创 2020-11-23 10:38:17 · 1799 阅读 · 0 评论 -
mybatis报错:There is no getter for property named ‘id‘ in ‘class java.lang.Long‘
mybatis报错:org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'id' in 'class java.lang.Long'xml中,sql如下:select dd.*from sys_mouldtype_device md,原创 2020-11-20 20:16:14 · 1929 阅读 · 1 评论 -
Mybatis报错:Caused by: java.lang.ClassNotFoundException: Cannot find class: SysLineResult
报这个错是由于粘贴复制后,没有改返回值属性,如下 <select id="selectLineListByMattypeCode" parameterType="Long" resultType="SysLineResult"> select l.* from sys_materialtype_line ml, sys_dict_data dd, sys_line原创 2020-11-17 17:48:54 · 718 阅读 · 0 评论