-
1. Re: Problem with java.sql.Date as Variable
roberto Oct 11, 2008 11:27 AM (in response to roberto)I found the problem (I believe....) but I don't know how to fix it.
I believe it is a problem related to hibernate.
The JBPM_VARIABLEINSTANCE table contains a column DATEVALUE_ of type "timestamp" and the hibernate mapping use that column for every java.util.Date (or extends) classes.
So java.sql.Date will be a java.sql.Timestamp when read it back.
So, I believe it is necessary to change this behaviours.
I believe there are only 2 way:
1) add 2 new columns to JBPM_VARIABLEINSTANCE in order to add a Date and a Time column.
add mapping for this 2 new column
2) change the org.jbpm.context.exe.variableinstance.DateInstance (...create a new class estending from it) that analize data and return back a java.sql.Date or a java.sql.Time or a java.sql.Timestamp according column value.
but.. I don't know hibernate .. so I believe this is not the right way and/or how to do it
Can someone help me ?
thanks -
2. Re: Problem with java.sql.Date as Variable
kukeltje Oct 11, 2008 11:40 AM (in response to roberto)why don't you just use a java.util.Date?
Much easier, future proof etc... -
3. Re: Problem with java.sql.Date as Variable
roberto Oct 12, 2008 8:52 AM (in response to roberto)it is very simple.
My ERP application use java.sql.Date, java.sql.Timestamp and java.sql.Time field/columns.
I need to set ERP column as variable in the process instance and read it back and obtain the same object. -
4. Re: Problem with java.sql.Date as Variable
kukeltje Oct 12, 2008 2:50 PM (in response to roberto)the same object? or the same value? A small wrapper to convert it for you is much easier I think then making changes to the jBPM core. Or you can even try to write a converter for jBPM. (see the testcases in the source how this can be done).
-
5. Re: Problem with java.sql.Date as Variable
roberto Oct 13, 2008 4:33 AM (in response to roberto)Thanks for all kukeltje.
I decide to convert myself from java.sql.Timestamp returned by jBPM to my right java type.
it is only some additional operations (of course less code.. better performnace... :) )