Hi, I want to setup Hibernate (6.6) and SQL Server (2019) with Unicode. In the Microsoft docs I found the information, that since SQL Server 2019 the VARCHAR type can be used with UTF-8, if the collation is set to UTF-8 (i.e. Latin1_General_100_CI_AS_SC_UTF8). The previous way is NVARCHAR (UTF-16).
What is the recommend way to use Unicode with Hibernate and SQL Server? And which configuration is needed in Hibernate? It does not matter whether the result is UFT-8 or UTF-16.
I also have a second case, with an already existing SQL Server database (Latin1_General_CI_AS) which should be converted to Unicode and should also use Hibernate. I have concerns about the primary keys, which are defined as UUID String:
@Id
@GeneratedValue(generator = "system-uuid")
@GenericGenerator(name = "system-uuid", strategy = "uuid2")
@Size(max = 36)
@Column(length = 36)
private String id;
In the database the id column is VARCHAR(36).
How to convert the database in a good way and how to handle the primary keys?