override mybatis-spring-boot-starter xml files

33 views
Skip to first unread message

lou lee

unread,
Dec 28, 2021, 11:50:30 PM12/28/21
to mybatis-user
I'm trying to override the XML file again. I have two mapper files with the same namespace , one is in a jar package, and I'm going to override it. I'm using 1.3.2 Version of mybatis-spring-boot-starter.

Peter Cao

unread,
Dec 29, 2021, 2:01:09 AM12/29/21
to mybatis-user
What does it meaningful? I suggest to look at https://www.spdycoding.com, it can help you to generate xml for not only single table but also complex select SQLs and will help you improve your productivity greatly.

lou lee

unread,
Dec 29, 2021, 2:09:43 AM12/29/21
to mybatis-user

Thank you, but my company doesn't use that tool. Because I added fields and changed the service, I need to override the mapper file.

Peter Cao

unread,
Dec 29, 2021, 2:24:30 AM12/29/21
to mybati...@googlegroups.com
OK, Thank you, I have already tried it and it's great.

lou lee <sao769...@gmail.com> 于2021年12月29日周三 15:09写道:
--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/44947473-b44e-4100-aff4-f8f36e620983n%40googlegroups.com.

lou lee

unread,
Dec 29, 2021, 3:26:16 AM12/29/21
to mybatis-user
OK, as far as I know, mybatis has a plugin called unmergeablexmlmappers, which can be configured to override or append, but I don't know what to do in mybatis spring boot starter

Peter Cao

unread,
Dec 29, 2021, 3:56:29 AM12/29/21
to mybati...@googlegroups.com
I don't think you need to do this, Why do you just add another mybatis mapper file and modify you service, It's easiest way to solve your problem.

lou lee <sao769...@gmail.com> 于2021年12月29日周三 16:26写道:
You received this message because you are subscribed to a topic in the Google Groups "mybatis-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mybatis-user/tIrRrmtGTbo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mybatis-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/95c6a81e-0d8e-4a23-aa66-845d86bee847n%40googlegroups.com.

lou lee

unread,
Dec 29, 2021, 4:10:03 AM12/29/21
to mybatis-user
For example, I use an open source code, but due to different requirements, some of the code can not meet the needs of our company, so I need to overwrite its mapper file instead of adding mapersstatement, so I don't need to change its logic code.
Reply all
Reply to author
Forward
0 new messages