When you use @MapsId on the Address.user, it actually means that the Address entity will borrow the identifier from the one-to-one association. So, you should not use @GeneratedValue annotation for the Address.id. (See this) 这篇关于在Spring Data JPA中使用@PrimaryKeyJoinColumn批注的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!