You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As shown in the picture, in order to make coding more comfortable, I hope to put the xml file into the package of the source code. This has two benefits:
I can easily design the Java interface and configure it because they are all together.
MyBatis can directly scan the BlogMapper interface in the package and directly learn the namespace of BlogMapper.xml. There is no need to manually configure it to avoid the possibility of errors.
However, unfortunately, mybatis does not support this function. I still have to maintain the namespace. I prefer that the configuration file is just an auxiliary to the code. I don’t want to pay attention to whose configuration file belongs to it, and just put it directly into the interface package. , so intuitive and comfortable.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
As shown in the picture, in order to make coding more comfortable, I hope to put the xml file into the package of the source code. This has two benefits:
However, unfortunately, mybatis does not support this function. I still have to maintain the namespace. I prefer that the configuration file is just an auxiliary to the code. I don’t want to pay attention to whose configuration file belongs to it, and just put it directly into the interface package. , so intuitive and comfortable.
Beta Was this translation helpful? Give feedback.
All reactions