The MyBatis type handlers supporting types of ThreeTen-Extra.
If you are using Maven add the following dependency to your pom.xml
:
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-typehandlers-threeten-extra</artifactId>
<version>1.0.0</version>
</dependency>
If you are using Gradle add the following dependency to your build.gradle
:
compile("org.mybatis:mybatis-typehandlers-threeten-extra:1.0.0")
Add following configuration to your mybatis-config.xml
:
<typeHandlers>
<!-- ... -->
<package name="org.mybatis.typehandlers.threetenextra"/>
</typeHandlers>
The following type handlers are supported:
Type handler | ThreeTen-Extra type | JDBC types |
---|---|---|
DayOfMonthTypeHandler |
org.threeten.extra.DayOfMonth |
INTEGER |
DayOfYearTypeHandler |
org.threeten.extra.DayOfYear |
INTEGER |
SecondsTypeHandler |
org.threeten.extra.Seconds |
INTEGER |
MinutesTypeHandler |
org.threeten.extra.Minutes |
INTEGER |
HoursTypeHandler |
org.threeten.extra.Hours |
INTEGER |
DaysTypeHandler |
org.threeten.extra.Days |
INTEGER |
WeeksTypeHandler |
org.threeten.extra.Weeks |
INTEGER |
MonthsTypeHandler |
org.threeten.extra.Months |
INTEGER |
YearsTypeHandler |
org.threeten.extra.Years |
INTEGER |
YearWeekTypeHandler |
org.threeten.extra.YearWeek |
VARCHAR or LONGVARCHAR |
YearQuarterTypeHandler |
org.threeten.extra.YearQuarter |
VARCHAR or LONGVARCHAR |
Note:
For more details of type handler, please refer to "MyBatis 3 REFERENCE DOCUMENTATION".