You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was reading the changelog for mybatis-spring-2.0.5 and noticed #458. Since I want to avoid XML configuration files, my usage of SqlSessionFactoryBean looks like this:
@BeanpublicSqlSessionFactorysqlSessionFactory(DataSourcedataSource) throwsException {
varfactory = newSqlSessionFactoryBean();
factory.setDataSource(dataSource);
// Mapper configurationvarconfiguration = neworg.apache.ibatis.session.Configuration();
configuration.setAutoMappingBehavior(AutoMappingBehavior.FULL);
configuration.setMapUnderscoreToCamelCase(true);
configuration.setDefaultEnumTypeHandler(CustomEnumTypeHandler.class);
configuration.getTypeHandlerRegistry().register(LocalDate.class, CustomLocalDateTypeHandler.class);
factory.setConfiguration(configuration);
// Register the model classes as type aliasesfactory.setTypeAliasesPackage(MyModel.class.getPackage().getName());
returnfactory.getObject();
}
#458 introduced another "layer" of option of the already existing Configuration class for setDefaultEnumTypeHandler. I went back to the documentation and noticed that the possibility of using Java configuration is not explained anywhere. Perhaps this could be added to the documentation? Or is one not supposed to use that api for configuration?
The text was updated successfully, but these errors were encountered:
I was reading the changelog for mybatis-spring-2.0.5 and noticed #458. Since I want to avoid XML configuration files, my usage of
SqlSessionFactoryBean
looks like this:#458 introduced another "layer" of option of the already existing
Configuration
class forsetDefaultEnumTypeHandler
. I went back to the documentation and noticed that the possibility of using Java configuration is not explained anywhere. Perhaps this could be added to the documentation? Or is one not supposed to use that api for configuration?The text was updated successfully, but these errors were encountered: