It looks like I have to implement com.ibatis.sqlmap.client.extensions.TypeHandlerCallback for both DateTime and LocalDateTime Joda types. This isn’t a big deal, but if it’s implemented somewhere else I’d rather just use that.
It looks like I have to implement com.ibatis.sqlmap.client.extensions.TypeHandlerCallback for both DateTime and LocalDateTime Joda
Share
There are no clean and flexible solutions, IMO. Jodatime dates are more flexible than the JDBC native types (
java.sql.Date,java.sql.Timestamp…) and if you map to them you might be losing information (timezones). An “full” implementation, (perhaps bypassing thegetDate()/getTimestamp()etc JDBC methods, using strings for example) would depend on your JDBC driver and database (and practically no database has datetime type as expressive as Jodatime’s).Here’s a rather trivial implementation I did once for
LocalDateTime. Not very tested, and it assumes your DB timestamps represent local datetimes.