Issue
I try to generate a trigger, in the trigger statement I have to set a column of type decimal(17,3) with the actual timestamp or the seconds of unix timestamp, but could not find a solution.
Solution
I found the solution
specify the datatype in the mysql table as decimal(17,3) hibernate map decimal to the Java type BigDecimal, and the with a simple function:
public static Date bigDec2Date(BigDecimal tsp) {
Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(tsp.longValue());
return cal.getTime();
}
Answered By - Alex Answer Checked By - Cary Denson (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.