1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.hr.time.util;
17
18 import java.sql.Timestamp;
19
20 import org.apache.ojb.broker.accesslayer.conversions.ConversionException;
21 import org.apache.ojb.broker.accesslayer.conversions.FieldConversion;
22
23 public class TkTimestampConverter implements FieldConversion{
24
25
26
27
28 private static final long serialVersionUID = 1L;
29
30 @Override
31 public Object javaToSql(Object arg0) throws ConversionException {
32 if(arg0 == null){
33 return new Timestamp(TKUtils.getCurrentDate().getTime());
34 }
35 return arg0;
36 }
37
38 @Override
39 public Object sqlToJava(Object arg0) throws ConversionException {
40 return arg0;
41 }
42
43 }