更新时间:2023-02-04 16:47:42
除了 @Column(name="...", columnDefinition = "uniqueidentifier")
,另见 在 JPA/hibernate 中映射 UUID 的问题 .
或者,您可以在 Java 中使用 String
字段作为 id,而在 SQL Server 中仍然保留 uniqueidentifier
.
Alternatively you can use a String
field for the id in Java and still keep uniqueidentifier
in SQL Server.