Hi, Since version 5.6.6.Final and probably this change : HHH-15097 Closed the AttributeConverter with UUID stored as binary(16) is not used anymore (tested with Mariadb(10.4) and H2 in reproducer) . As the AttributeConverter is not executed, insert failed to insert a uuid into the binary(16). Mariadb: Insert >Caused by: java.sql.SQLException: Data too long for column 'someValue' at row 1 Same for read, where the binary(16) cannot be translated as UUID. >java.lang.IllegalArgumentException: Invalid UUID string: F��$:O��zdZ��� H2: Insert >Caused by: org.h2.jdbc.JdbcSQLDataException: Valeur trop longue pour la colonne "SOMEVALUE BINARY(16)": "CAST(X'62363564393434652d656636662d346265622d383236332d663966373963376363626136'... (36)" Value too long for column "SOMEVALUE BINARY(16)": "CAST(X'62363564393434652d656636662d346265622d383236332d663966373963376363626136'... (36)"; SQL statement: insert into TestEntity (someValue, id) values (?, ?) [22001-214] Read >java.lang.IllegalArgumentException: Invalid UUID string: F��$:O��zdZ��� Reproducer : branch main : https://github.com/douph1/hibernate-test-case-templates JPAUnitTestCase > HHH15097TestInsert() and HHH15097TestRead() I think it is related to this fixed VARCHAR https://github.com/hibernate/hibernate-orm/pull/4860/commits/0ea2c11dff943ae8063fd355d4e7fd6cff9e6a92 @Override public SqlTypeDescriptor getJdbcRecommendedSqlType(JdbcRecommendedSqlTypeMappingContext context) { return context.getTypeConfiguration().getSqlTypeDescriptorRegistry().getDescriptor( Types.VARCHAR ); } As stated in the doc the binary is the default storage format for database that don't handle UUID type. https://docs.jboss.org/hibernate/orm/5.6/userguide/html_single/Hibernate_User_Guide.html#basic-uuid >The default UUID mapping is the binary one because it uses a more efficient column storage. >2.3.11. UUID as binary >As mentioned, the default mapping for UUID attributes. Maps the UUID to a byte[] using >java.util.UUID#getMostSignificantBits and java.util.UUID#getLeastSignificantBits and stores that as BINARY >data. > >Chosen as the default simply because it is generally more efficient from a storage perspective. Thanks |