I am trying to map a UUID column in POJO to SQL Server table column using Hibernate.
The annotations are applied as follows:
@Id
@Genera
Microsoft databases use GUIDs. It is Microsoft's implementation of the UUID standard.
This being said, you should use the guid generator.
@Id
@GenericGenerator(name = "generator", strategy = "guid", parameters = {})
@GeneratedValue(generator = "generator")
public String getId() {
return id;
}
guiduses a database-generated GUID string on MS SQL Server and MySQL.
Also, have you set SQLServer2012Dialect? This also might solve some future issues.