org.apache.ibatis.type.DoubleTypeHandler Java Examples

The following examples show how to use org.apache.ibatis.type.DoubleTypeHandler. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MybatisConfig.java    From BlogManagePlatform with Apache License 2.0 5 votes vote down vote up
@Bean
public ConfigurationCustomizer configurationCustomizer() {
	return new ConfigurationCustomizer() {

		@SuppressWarnings("unused")
		private int a = 1;

		@Override
		public void customize(org.apache.ibatis.session.Configuration configuration) {
			TypeHandlerRegistry registry = configuration.getTypeHandlerRegistry();
			registry.register(Object.class, JdbcType.BIT, new BooleanTypeHandler());
			registry.register(Object.class, JdbcType.BOOLEAN, new BooleanTypeHandler());
			registry.register(Object.class, JdbcType.TINYINT, new ByteTypeHandler());
			registry.register(Object.class, JdbcType.SMALLINT, new ShortTypeHandler());
			registry.register(Object.class, JdbcType.INTEGER, new IntegerTypeHandler());
			registry.register(Object.class, JdbcType.BIGINT, new LongTypeHandler());
			registry.register(Object.class, JdbcType.FLOAT, new FloatTypeHandler());
			registry.register(Object.class, JdbcType.DOUBLE, new DoubleTypeHandler());
			registry.register(Object.class, JdbcType.VARCHAR, new StringTypeHandler());
			registry.register(Object.class, JdbcType.LONGVARCHAR, new StringTypeHandler());
			registry.register(Object.class, JdbcType.CHAR, new StringTypeHandler());
			registry.register(Object.class, JdbcType.REAL, new BigDecimalTypeHandler());
			registry.register(Object.class, JdbcType.DECIMAL, new BigDecimalTypeHandler());
			registry.register(Object.class, JdbcType.NUMERIC, new BigDecimalTypeHandler());
		}
	};
}