报错信息:
### Error updating database. Cause: java.sql.SQLIntegrityConstraintViolationException: Duplicate entry '7-6' for key 'PRIMARY'
### The error may exist in file [D:\xiangmu\ssm-system\target\classes\mapper\RoleMapper.xml]
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: insert into sys_role_permission (rid,pid) values (?,?)
### Cause: java.sql.SQLIntegrityConstraintViolationException: Duplicate entry '7-6' for key 'PRIMARY'
; Duplicate entry '7-6' for key 'PRIMARY'; nested exception is java.sql.SQLIntegrityConstraintViolationException: Duplicate entry '7-6' for key 'PRIMARY'
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:247)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:70)
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:74)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:440)
at com.sun.proxy.$Proxy52.insert(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:271)
at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:58)
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:61)
at com.sun.proxy.$Proxy67.addRolePermisson(Unknown Source)
at com.cc.service.impl.RoleServiceImpl.addRolePermisson(RoleServiceImpl.java:66)
at com.cc.controller.RoleController.addRolePermisson(RoleController.java:121)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
报错原因:数据库关联主键
解决方案:取消钥匙,可以为空