I have a JAVA POJO class with hibernate annotation for postgresql database.
Now, I have a requirement that we support multiple databases in our application. My question is : Should we use the same class with other databases (Oracle, MySQL, SQL Server) or should I write separate annotated class for each different database ?
Reason: To support special characters we are using database proprietary types instead of hibernate types like
// for oracle
@Column(sql-type="nvarchar2")
private String name;
// for sql server
@Column(sql-type="nvarchar")
private String name;
// hibernate doesn't support different proprietary sql types at same type like this
@Column(sql-type={"nvarchar","nvarchar2"})
private String name;