Problems mapping UUID in JPA/hibernate

前端 未结 6 1152
既然无缘
既然无缘 2020-12-05 10:20

According to the documentation, hibernate 3.6 should have support for the java.util.UUID type. But when I map it like:

@Id protected UUID uuid;
6条回答
  •  猫巷女王i
    2020-12-05 10:39

    UUID was a basic type added in 3.6. However, by default it translates to a JDBC Binary type which appears to cause issues for mysql. You can override this behavior by explicitly specifying uuid-char as the type.

提交回复
热议问题