-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Does not work Cursor using annotation based Mapper #661
Comments
I've modified the // if (Collection.class.isAssignableFrom(rawType)) { ← ### Original code ###
if (Iterable.class.isAssignableFrom(rawType)) { // ← ### Changed code ###
Type[] actualTypeArguments = parameterizedType.getActualTypeArguments();
if (actualTypeArguments != null && actualTypeArguments.length == 1) {
Type returnTypeParameter = actualTypeArguments[0];
if (returnTypeParameter instanceof Class<?>) {
returnType = (Class<?>) returnTypeParameter;
} else if (returnTypeParameter instanceof ParameterizedType) {
// (gcode issue #443) actual type can be a also a parameterized type
returnType = (Class<?>) ((ParameterizedType) returnTypeParameter).getRawType();
} else if (returnTypeParameter instanceof GenericArrayType) {
Class<?> componentType = (Class<?>) ((GenericArrayType) returnTypeParameter).getGenericComponentType();
// (gcode issue #525) support List<byte[]>
returnType = Array.newInstance(componentType, 0).getClass();
}
} This code was worked. What do you think ? |
I would check especifically for Cursor instead of for iterable. 2016-04-23 17:57 GMT+02:00 Kazuki Shimizu [email protected]:
|
…on-based-mapper Support Cursor on annotation based Mapper interface #661
please add milestone!! |
Thanks for pointing @kazuki43zoo ! |
…annotaion-based-mapper Support Cursor on annotation based Mapper interface mybatis#661
MyBatis version
3.4.0
Database vendor and version
Any
Test case or example project
N/A
Steps to reproduce
At first, i add method in
BoundBlogMapper
as follow:At second, i add test method in
BindingTest
as follow:Expected result
Actual result
The text was updated successfully, but these errors were encountered: