Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve type handler based on java.lang.reflect.Type instead of Class and respect runtime JDBC type #3379

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

harawata
Copy link
Member

@harawata harawata commented Jan 3, 2025

A lot of related issues: #995 #1445 #2187 #3155

It's not ready for a proper review yet, but developers are welcome to test the functionality.
If you found a problematic use case, please share a test case.

# Conflicts:
#	src/main/java/org/apache/ibatis/builder/BaseBuilder.java
#	src/main/java/org/apache/ibatis/builder/MapperBuilderAssistant.java
#	src/main/java/org/apache/ibatis/builder/SqlSourceBuilder.java
#	src/main/java/org/apache/ibatis/builder/annotation/MapperAnnotationBuilder.java
#	src/main/java/org/apache/ibatis/builder/xml/XMLMapperBuilder.java
#	src/main/java/org/apache/ibatis/builder/xml/XMLStatementBuilder.java
#	src/main/java/org/apache/ibatis/executor/resultset/DefaultResultSetHandler.java
#	src/main/java/org/apache/ibatis/mapping/ParameterMapping.java
#	src/main/java/org/apache/ibatis/mapping/ResultMapping.java
#	src/main/java/org/apache/ibatis/reflection/MetaClass.java
#	src/main/java/org/apache/ibatis/reflection/Reflector.java
#	src/main/java/org/apache/ibatis/reflection/ReflectorFactory.java
#	src/main/java/org/apache/ibatis/scripting/defaults/DefaultParameterHandler.java
#	src/main/java/org/apache/ibatis/scripting/xmltags/XMLLanguageDriver.java
#	src/main/java/org/apache/ibatis/session/AutoMappingUnknownColumnBehavior.java
#	src/main/java/org/apache/ibatis/type/TypeHandlerRegistry.java
#	src/test/java/org/apache/ibatis/builder/XmlMapperBuilderTest.java
#	src/test/java/org/apache/ibatis/reflection/ReflectorTest.java
#	src/test/java/org/apache/ibatis/reflection/TypeParameterResolverTest.java
#	src/test/java/org/apache/ibatis/submitted/language/VelocitySqlSourceBuilder.java
@coveralls
Copy link

coveralls commented Jan 3, 2025

Coverage Status

coverage: 87.101% (-0.1%) from 87.217%
when pulling 1c658c0 on harawata:type-based-handler-resolution
into e202727 on mybatis:master.

# Conflicts:
#	src/main/java/org/apache/ibatis/builder/SqlSourceBuilder.java
#	src/main/java/org/apache/ibatis/executor/resultset/DefaultResultSetHandler.java
#	src/main/java/org/apache/ibatis/scripting/defaults/DefaultParameterHandler.java
#	src/main/java/org/apache/ibatis/scripting/defaults/RawSqlSource.java
#	src/main/java/org/apache/ibatis/scripting/xmltags/DynamicSqlSource.java
… account

Fail-fast is nice, but it practically prevents MyBatis from using runtime JDBC type information to resolve type handler.

Related to mybatis#9 mybatis#19
@harawata harawata added the no backward compatibility Includes change no backward compatibility for previous version label Jan 29, 2025
@harawata harawata changed the title Resolve type handler based on java.lang.reflect.Type instead of Class Resolve type handler based on java.lang.reflect.Type instead of Class and respect runtime JDBC type Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no backward compatibility Includes change no backward compatibility for previous version 🔩 typehandler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants