I have a table in my database for my Customer entity. This table contains some columns that are of type NVARCHAR (this is a requirement, I can not change it), but Hibernate is not able to map this column type to the correct property in my Entity without using the @Type annotation, it's complaining that it expectd a column with type VARCHAR instead of NVARCHAR:
@Entity
public class Customer {
// ...
@Column(name = "first_name", nullable = false)
@Type(type="org.hibernate.type.StringNVarcharType")
private String firstName;
// ...
}
Is there any way to configure hibernate to be able to map to the NVARCHAR type without using the @Type annotation, that is conform to the JPA specification?
Spring Boot version: 2.1.12.RELEASE
Hibernate version: 5.3.15.Final
Hibernate dialect: org.hibernate.dialect.SQLServer2012Dialect