Closed pink-lucifer closed 6 years ago
how to add pager or limit or offset sub condition? May be can add it
@hiabp I am not sure if i follow u, please provide more detail it not too much. Furthermore, please have a look if Mybatis-PageHelper is what you are looking for?
@hiabp This plugin is only for the integration of gradle and mybatis plugin. Usage of mybatis you can look on mytatis generator website.
@kimichen13
An update: start from generator 1.3.7 - a new useJSR310Types property has been introduced, set it to true will enable java8 time types. in config file:
<javaTypeResolver>
<property name="useJSR310Types" value="true"/>
</javaTypeResolver>
configuration reference - javaTypeResolver
Closing it, thanks a lot,
Greetings,
Hope this could add more detailed sample configuration for custom JavaTypeResolver;
In one of my project, spent bit of time while instroducing with Java 8 datetime api to figure out how to ... As follows:
create custom JavaTypeResolver(in jar com.xxx.xxx:mybatis-java8:0.0.1-SNAPSHOT) public class JDK8JavaTypeResolver extends JavaTypeResolverDefaultImpl { public JDK8JavaTypeResolver() { this.typeMap.replace(Integer.valueOf(91), new JdbcTypeInformation("DATE", new FullyQualifiedJavaType(LocalDate.class.getName()))); this.typeMap.replace(Integer.valueOf(92), new JdbcTypeInformation("DATE", new FullyQualifiedJavaType(LocalTime.class.getName()))); this.typeMap.replace(Integer.valueOf(93), new JdbcTypeInformation("DATE", new FullyQualifiedJavaType(LocalDateTime.class.getName()))); } }
Adding dependencies in gradle build file mybatisGenerator section mybatisGenerator { verbose = true configFile = 'src/main/resources/autogen/generatorConfig.xml' dependencies { mybatisGenerator "com.xxx.xxx:mybatis-java8:0.0.1-SNAPSHOT" mybatisGenerator 'org.mybatis.generator:mybatis-generator-core:1.3.5' mybatisGenerator 'mysql:mysql-connector-java:5.1.41' mybatisGenerator 'tk.mybatis:mapper:3.4.0' } }
Adding javaTypeResolver config in configure.xml
Especially, in build.gradle dependencies section: add mybatis-typehandlers-jsr310 compile group: 'org.mybatis', name: 'mybatis-typehandlers-jsr310', version: '1.0.2' see more detail: https://github.com/mybatis/typehandlers-jsr310
At your convinience, please help review ....
Hope this helps...
Cheers,