Menu

#152 postgresql type 'bytea' incorrectly mapped

closed
hibernate (22)
5
2004-10-27
2004-10-22
Anonymous
No

The HibernateJavaTypeMapper should map postgresql's 'bytea' type to 'binary'; instead
it's going to the default of Java.lang.String.

The one line fix, to line 86 of HibernateJavaTypeMapper.java:

else if (sqlType == Types.BINARY || sqlType == Types.VARBINARY || sqlType == Types.LONGVARBINARY || "bytea".equals(column.getSqlTypeName())) {

instead of the current:

else if (sqlType == Types.BINARY || sqlType == Types.VARBINARY || sqlType == Types.LONGVARBINARY) {

Discussion

  • David Channon

    David Channon - 2004-10-27

    Logged In: YES
    user_id=582419

    Commited the change.

     
  • David Channon

    David Channon - 2004-10-27
    • status: open --> closed
     
  • Nobody/Anonymous

    Logged In: NO

    Looks like HibernateJavaTypeMapper.java is mapping the postgres type "inet" incorrectly as well. Append this after the above to fix it:

    else if ("inet".equals(column.getSqlTypeName())) {
    result = "java.net.InetAddress";
    }

     

Log in to post a comment.

MongoDB Logo MongoDB