Hi Everyone ,
I am using hibernate 3.2.1 for inserting data in oracle and postgres, my problem is ,i need to map a column whose datatype is different in both databases .
say for EG : I have a string which i have to store as number in postgres and as varchar2 in oracle.
One way i found is ,using UserType of hibernate . In CustomUserType I am detecting the DB based based on prepared jdbc statement of nullsafeget() method and based on DB i am cating the value.
But the sqltypes() method can't take both the sql types (number and varchar).
Code:
private static final int[] SQL_TYPES = {java.sql.Types.VARCHAR};
public int[] sqlTypes() {
return SQL_TYPES;
}
Can someone please clarify what is the significance of sqltypes() method and is there any other way in hibernate to implement my use case ( insert different datatypes for same column.)
Hope i am clear ..
Thanks in advance,
Sas