3 Replies Latest reply on May 12, 2006 10:41 AM by bdruth

    bug in ConverterEnumType?

    thomchode

      I'm using oracle 9.2i with the native oracle jdbc driver and I think I've come across a bug. This is in the ConverterEnumType class in the nullSafeGet method. Basically, the resultSet.getString(names[0]) appends a space to the end of the value. The value in the database is 'R' (datatype is CHAR(1)). When I get the value of converterDatabaseId it is "R " (with a following space). It seems like the bug is in the oracle jdbc driver, but I'm wondering if its possible to have a workaround added to the jbpm code to do a .trim() on that value? I tried the datadirect trial jdbc driver and it did not append the space.


      public Object nullSafeGet(ResultSet resultSet, String[] names, Object owner) throws HibernateException, SQLException {
      String converterDatabaseId = resultSet.getString(names[0]);
      return Converters.getConverterByDatabaseId(converterDatabaseId);
      }

        • 1. Re: bug in ConverterEnumType?

          Are you trying to store java 1.5 Enums as VariableInstances? I'm trying to do the same thing .. but I think I took a different approach. Instead of creating a Hibernate user type, I created a JBPM converter (convert(), revert()).

          I can't get this to work, though - because of a problem with Hibernate when I try to do a Criteria query against a VariableInstance using the Enum (because the Enum is stored in the DB as a StringType)

          • 2. Re: bug in ConverterEnumType?
            thomchode

            I'm using jdk 1.4.2 and not doing anything custom. I'm just trying to use the base jbpm code.

            • 3. Re: bug in ConverterEnumType?

               

              "thomchode" wrote:
              I'm using jdk 1.4.2 and not doing anything custom. I'm just trying to use the base jbpm code.


              ok, nevermind ;)