一、<statement> or DELIMITER expected, got 'id',这个错误是发生在MyBatis的Mapper的XML文件的sql节点上,第一个字段是什么错误中最后一个单引号内部就是什么,
解决方案,干掉方框中的sql|
即:
问题一图解
二、Unable to resolve table '<table-name>'
问题2
解决方案:勾掉Unresolved refereence
![](http://upload-images.jianshu.io/upload_images/1025465-6620dcc3b22b5648.png?imageMogr2/auto-orient/strip|imageView2/2/w/812/format/webp)
问题2图解
三、Result type doesn't match for xxx
![](http://upload-images.jianshu.io/upload_images/1025465-570fcc7d2b22066a.png?imageMogr2/auto-orient/strip|imageView2/2/w/535/format/webp)
问题3
解决方案:勾掉Mapper Method inspection
![](http://upload-images.jianshu.io/upload_images/1025465-56b720705927ccbd.png?imageMogr2/auto-orient/strip|imageView2/2/w/920/format/webp)
问题3图解
四、'(', ':=', '=' or '[' expected, got 'id'
![](http://upload-images.jianshu.io/upload_images/1025465-3362d1cb17e2a756.png?imageMogr2/auto-orient/strip|imageView2/2/w/628/format/webp)
问题4
解决方案:去掉 where之前的,
即可
五、Usage of API documented as @since 1.6+
![](http://upload-images.jianshu.io/upload_images/1025465-72c88f672431f99d.png?imageMogr2/auto-orient/strip|imageView2/2/w/645/format/webp)
问题5
解决:
![](http://upload-images.jianshu.io/upload_images/1025465-738b17dd2f071d93.png?imageMogr2/auto-orient/strip|imageView2/2/w/920/format/webp)
问题5图解
六、Class '<class-name>' is never used
使用idea的时候发现很多多余的警告,可能是在Eclipse中习惯了吧,反而觉得Idea管的有点宽,一个类不用报警告,一个方法不用会报警告,但是我觉得这点Eclipse处理的还是比较得当的,public的可能是util中的,难不成现在删了?后面需要再加???
![](http://upload-images.jianshu.io/upload_images/1025465-5f0902c3fc84d8f1.png?imageMogr2/auto-orient/strip|imageView2/2/w/225/format/webp)
问题6
解决:
![](http://upload-images.jianshu.io/upload_images/1025465-d9a5c13158ba1f37.png?imageMogr2/auto-orient/strip|imageView2/2/w/918/format/webp)
问题6图解
七、Variable '<var-name>' initializer 'null' is redundant
![](http://upload-images.jianshu.io/upload_images/1025465-2e6a083d613aaa5c.png?imageMogr2/auto-orient/strip|imageView2/2/w/664/format/webp)
问题7
解决(光标放在null上,然后Alt+Enter就可以弹出提示):
![](http://upload-images.jianshu.io/upload_images/1025465-f4c2fab04fea13cd.png?imageMogr2/auto-orient/strip|imageView2/2/w/660/format/webp)
问题7图解
八、idea cannot resolve file "applicationContext.xml"
这个问题的原因就是idea找不到这个文件,也就是这个文件要放在字节码目录的根目录中,那么你:
- 首先检查有没有编写这个文件
- 其次看这个文件有没有放在resources目录下
- 看idea中这个resources有没有被标记为Resource Root
原文链接:https://www.jianshu.com/p/e20eb9645ce9