且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Java Hibernate 和 SQL Server 中 UUID 的不同表示

更新时间: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.