You need to specify the @Type(type = "uuid-char")
in addition to @Column(name="...", columnDefinition = "uniqueidentifier")
, see also Problems mapping UUID in JPA/hibernate .
Alternatively you can use a String
field for the id in Java and still keep uniqueidentifier
in SQL Server.