您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

spring data jdbc插入时报错:java.lang.IllegalArgumentException: After saving the identifier must not be null!

bubuko 2022/1/25 19:19:24 java 字数 835 阅读 1079 来源 http://www.bubuko.com/infolist-5-1.html

持久层框架:spring data jdbc 版本:2.1.2 报错:java.lang.IllegalArgumentException: After saving the identifier must not be null! 原因: 经过调试发现: 在spring在查找主键属性时(org.s ...

持久层框架:spring data jdbc

版本:2.1.2

报错:java.lang.IllegalArgumentException: After saving the identifier must not be null!

原因:

经过调试发现:

在spring在查找主键属性时(org.springframework.data.mapping.model.AnnotationBasedPersistentProperty#isId)只判断了属性是否有org.springframework.data.annotation.Id注解。

没有处理JPA中的注解javax.persistence.Id,如果使用此注解,会出现找不到主键的情况,造成id填充失败。

 

spring data jdbc插入时报错:java.lang.IllegalArgumentException: After saving the identifier must not be null!

原文:https://www.cnblogs.com/chenkeyu/p/14168724.html


如果您也喜欢它,动动您的小指点个赞吧

除非注明,文章均由 laddyq.com 整理发布,欢迎转载。

转载请注明:
链接:http://laddyq.com
来源:laddyq.com
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。


联系我
置顶