
Mybatis
文章平均质量分 67
屲亣猿猿
这个作者很懒,什么都没留下…
展开
-
mybatisPlus乐观锁报错解决方法
在初学mybatisPlus乐观锁时,遇到了这样的错误。在此给大家展现出来,避免后面踩坑。org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'MP_OPTLOCK_VERSION_ORIGINAL' not found. Available parameters are [param1, et]遇到这种错误,有两种解决办法:原创 2021-07-17 12:34:53 · 3057 阅读 · 8 评论 -
Mybatis全网最详细教程(纯注解编程),包看包会!
Mybatis的注解开发说明:因为是纯注解,所以没有任何xml配置文件,只需要写一个before()方法,将配置代码放入即可,这里面的配置相当于sqlMapConfig.xml配置文件,后面直接调用即可,接口对应的xml不要,直接在接口上面注解sql语句就ok。如下 private UserMapper sm; @Before public void before() throws IOException { //建立数据源 DruidDataSource原创 2021-07-16 13:08:52 · 2797 阅读 · 1 评论 -
Caused by: java.lang.ClassCastException: class com.github.pagehelper.PageHelper cannot be cast to cl
笔者在初学Mybatis使用pageHelp遇到了坑,为了避免其他初学者踩坑,第一时间将解决办法呈现给大家。报错前的sqlMapConfig.xml文件配置如下,此配置适用于mysql 5.0以及5.0以下版本的配置:<plugins> <plugin interceptor="com.github.pagehelper.PageHelper"> <!--设置数据局库的类型,用的是mysql就设置为mysql-->原创 2021-07-13 16:46:22 · 1116 阅读 · 0 评论