3 Replies Latest reply on Feb 7, 2013 9:55 AM by swiderski.maciej

    Invalid JPA definition for ProcessInstanceLog v5.4.0, leads to Hibernate exception

    jserdaru

      Hello, there. I see that the ProcessInstanceLog class has been modified between 5.3.0 and 5.4.0. The following persistent properties have been added:

       

      @Column(nullable=true)
      private int status;
      @Column(nullable=true)
      private long parentProcessInstanceId;
      @Column(nullable=true)
      private String outcome;

       

      However, I think having a nullable property with a primitive type is not going to work when loading data with the "parentProcessInstanceId" or "status" having null values (which happens in my case).

       

      Hibernate complains:

       

      Caused by: java.lang.IllegalArgumentException: Can not set long field org.jbpm.process.audit.ProcessInstanceLog.parentProcessInstanceId to null value

          at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:146)

          at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:150)

          at sun.reflect.UnsafeLongFieldAccessorImpl.set(UnsafeLongFieldAccessorImpl.java:62)

          at java.lang.reflect.Field.set(Field.java:657)

          at org.hibernate.property.DirectPropertyAccessor$DirectSetter.set(DirectPropertyAccessor.java:139)

       

      I think a simple fix would be to substitute int with Integer, long with Long, and modifiy the setter/getter methods accordingly.

       

      Am i the only one with the problem? Should I open an issue on Jira?

       

      Thanks for your help.