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

Can typehandler be separated from mybatis? #3304

Open
Ai-010 opened this issue Nov 28, 2024 · 4 comments
Open

Can typehandler be separated from mybatis? #3304

Ai-010 opened this issue Nov 28, 2024 · 4 comments

Comments

@Ai-010
Copy link

Ai-010 commented Nov 28, 2024

I have already open sourced a framework called "mybatis-mp" based on mybatis. My entity class annotations need to rely on mybatis' typehandler, and I hope the annotation module of "mybatis-mp" can be made smaller and less dependent, but the typehandler property depends on mybatis dependencies. I hope mybatis can extract the typehandler from mybatis and make it a small module. My open source address is:

https://github.com/mybatis-mp/mybatis-mp

@documented
@retention(RetentionPolicy.RUNTIME)
@target(ElementType.FIELD)
public @interface TableField {
Class> typeHandler() default UnknownTypeHandler.class;
......
}

Mybatis mp is currently very user-friendly:

Pager<SysUser> pager= QueryChain.of(sysUserMapper) .like(SysUser::getUserName,"abc") .paging(Pager.of(1));

@hazendaz
Copy link
Member

I cannot answer for others, but I think splitting a few things from the mybatis core making other modules would be a good improvement as we get a lot of requests for type handles we don't want to support but honestly we should. Me being a direct contributor, I even have type-handlers at work that should be in mybatis. So if others agree (2 or 3 others) then maybe that could happen.

@Ai-010
Copy link
Author

Ai-010 commented Nov 28, 2024

I cannot answer for others, but I think splitting a few things from the mybatis core making other modules would be a good improvement as we get a lot of requests for type handles we don't want to support but honestly we should. Me being a direct contributor, I even have type-handlers at work that should be in mybatis. So if others agree (2 or 3 others) then maybe that could happen.

Thank you for your reply;If this can be done, it is indeed beneficial for expanding based on mybatis, although some changes are needed for mybatis。

@harawata
Copy link
Member

What does "separate type handlers" mean?
I'm not sure how you design your project, but we will not move the TypeHandler interface out of the core.

@Ai-010
Copy link
Author

Ai-010 commented Nov 28, 2024

What does "separate type handlers" mean? I'm not sure how you design your project, but we will not move the TypeHandler interface out of the core.

Just a suggestion,More friendly to open source frameworks based on MyBatis;I believe other open source projects also have similar requirements。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants