1

I'm encountering the following exception with hibernate:

java.sql.SQLException: Incorrect string value: '\xD4BRh\xF09...' for column 'id' at row 1

I have a Java/JPA/Hibernate/MySQL based app. I want to use UUIDs for object identity. This is when trying to save a uuid in a mysql database. The database is configured to use utf8mb4 (and utf8mb4_general_ci collation). MySQL version 8.0.22

With the following column definition

@Id
@GeneratedValue(generator = "UUID")
@GenericGenerator(
        name = "UUID",
        strategy = "org.hibernate.id.UUIDGenerator"
)
@Column(name = "id", updatable = false, nullable = false)
private UUID id;

Is there something I'm missing? Thank you!

  • What database type do you use for the id column? What hibernate dialect do you use? What hibernate version do you use? – SternK Nov 12 '20 at 12:23
  • my id coloum type is `binary(16)` and i use hibernate dialect MySQL57Dialect, which i currently use hibernate version is 5.4.23 –  Nov 12 '20 at 17:23

0 Answers0