Support for .NET TimeSpan (Sql Time)

114 views
Skip to first unread message

Rob Smith

unread,
Feb 9, 2014, 7:42:24 PM2/9/14
to mybatis...@googlegroups.com
Hello All,

I've not been able to figure out how to get Ibatis to support the TimeSpan .NET type (SqlDbType.Time).

Does Ibatis support the Time/TimeSpan type and I'm missing something??

Thank you in advance,

Rob

Michael McCurrey

unread,
Feb 10, 2014, 7:26:46 AM2/10/14
to mybatis...@googlegroups.com
You have to use a type-handler for most databases.

in your SqlMapConfig.
 <typeAlias alias="TimeConverter" type="Infrastructure.Db.TypeHandlers.MyDatabaseTimeTypeHandler , Infrastructure.DB"/>

 <typeHandler type="System.TimeSpan" dbType="Integer" callback="TimeConverter" />


Then define yourself a typehandler.
public sealed class MyDatabaseTimeTypeHandler : ITypeHandlerCallback


--
You received this message because you are subscribed to the Google Groups "mybatisnet-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatisnet-us...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Michael J. McCurrey
Read with me at http://www.mccurrey.com
http://chaoticmindramblings.blogspot.com/
Reply all
Reply to author
Forward
0 new messages