0 Replies Latest reply on Feb 22, 2010 2:49 PM by Dominic Umbeer

    Saving a Date or Timestamp in database

    Dominic Umbeer Newbie

      In default case a java.util.Date variable will stored as String in the jbpm4_variable table! See following line of the jbpm.variable.types.xml (included in jbpm.jar) file:

       

      <type name="date"    class="java.util.Date" converter="org.jbpm.pvm.internal.type.converter.DateToStringConverter" variable-class="org.jbpm.pvm.internal.type.variable.StringVariable" />

       

      The jbpm4_variable table has a DATE_VALUE column to store timestamps, so Date's too. Is there any reason why Date's are converted to String's and not stored to DATE_VALUE column directly?

       

      When I add something like the following to jbpm.variable.types.xml and comment out the previous line then the Date's will stored to the DATE_VALUE column.

       

      <type name="date" class="java.util.Date" variable-class="org.jbpm.pvm.internal.type.variable.DateVariable" />

       

      Best regards