Using MyBatisModule :: addMapperClass with Mapper XML File

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Using MyBatisModule :: addMapperClass with Mapper XML File

Asaf Mesika
Hi,

After much trial and error we've discovered when you use MyBatisModule.addMapperClass() it forces you to create a directory chain in src/main/resources which is identical to the directory chain (package name) of the mapper class (interface).

This is different from using MyBatisXMLModule where you specify the location of the XML file.

What I don't understand is why addMapperClass(type) can't be addMappperClass(type, xmlClasspath), allowing you to place this XML any where you want just like you can in the config XML file.


Any thoughts?

Asaf Mesika
Loz.io

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Using MyBatisModule :: addMapperClass with Mapper XML File

Poitras Christian
Hi,

This is due to an old design decision to simplify things. If you use MyBatis alone, it is a good design choice to put the XML and Java code side by side since they almost always change together, although MyBatis does not force you to do that.

You can add this method to the MyBatisModule on GitHub if you want and I will merge it.

Best regards,
Christian

De : <[hidden email]<mailto:[hidden email]>> on behalf of Asaf Mesika <[hidden email]<mailto:[hidden email]>>
Répondre à : "[hidden email]<mailto:[hidden email]>" <[hidden email]<mailto:[hidden email]>>
Date : Tuesday, June 21, 2016 at 4:06 AM
À : mybatis-user <[hidden email]<mailto:[hidden email]>>
Objet : Using MyBatisModule :: addMapperClass with Mapper XML File

Hi,

After much trial and error we've discovered when you use MyBatisModule.addMapperClass() it forces you to create a directory chain in src/main/resources which is identical to the directory chain (package name) of the mapper class (interface).

This is different from using MyBatisXMLModule where you specify the location of the XML file.

What I don't understand is why addMapperClass(type) can't be addMappperClass(type, xmlClasspath), allowing you to place this XML any where you want just like you can in the config XML file.


Any thoughts?

Asaf Mesika
Loz.io


--
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 [hidden email]<mailto:[hidden email]>.
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Using MyBatisModule :: addMapperClass with Mapper XML File

Poitras Christian
On second look, the MyBatis Java configuration seems to force you to keep
the XML and Java file together.
The Configuration class only has one addMapper(Class) method so you cannot
choose the location of the XML file.

This will make it nearly impossible to change the MyBatisModule since it
relies on the Configuration class.


Le 2016-06-21, 9:39 AM, « [hidden email] on behalf of
Poitras Christian » <[hidden email] on behalf of
[hidden email]> a écrit :

>Hi,
>
>This is due to an old design decision to simplify things. If you use
>MyBatis alone, it is a good design choice to put the XML and Java code
>side by side since they almost always change together, although MyBatis
>does not force you to do that.
>
>You can add this method to the MyBatisModule on GitHub if you want and I
>will merge it.
>
>Best regards,
>Christian
>
>De :
><[hidden email]<mailto:[hidden email]>> on
>behalf of Asaf Mesika
><[hidden email]<mailto:[hidden email]>>
>Répondre à :
>"[hidden email]<mailto:[hidden email]>"
><[hidden email]<mailto:[hidden email]>>
>Date : Tuesday, June 21, 2016 at 4:06 AM
>À : mybatis-user
><[hidden email]<mailto:[hidden email]>>
>Objet : Using MyBatisModule :: addMapperClass with Mapper XML File
>
>Hi,
>
>After much trial and error we've discovered when you use
>MyBatisModule.addMapperClass() it forces you to create a directory chain
>in src/main/resources which is identical to the directory chain (package
>name) of the mapper class (interface).
>
>This is different from using MyBatisXMLModule where you specify the
>location of the XML file.
>
>What I don't understand is why addMapperClass(type) can't be
>addMappperClass(type, xmlClasspath), allowing you to place this XML any
>where you want just like you can in the config XML file.
>
>
>Any thoughts?
>
>Asaf Mesika
>Loz.io
>
>
>--
>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
>[hidden email]<mailto:mybatis-user+unsubscribe@
>googlegroups.com>.
>For more options, visit https://groups.google.com/d/optout.
>
>--
>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 [hidden email].
>For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re[2]: Using MyBatisModule :: addMapperClass with Mapper XML File

Guy Rouillier-2
In reply to this post by Poitras Christian
In a Maven web project, we standardized on putting the XML files (both
config and mapper) in src/main/resources, while the Java files go into
src/main/java.  This is more in keeping with the Maven conventions.  For
simplicities sake, we just put all the XML files in the root directory,
rather than creating the subdirectories reflecting the classpath of the
corresponding Java class.  We specify the full classpath of the Java
class using the namespace attribute of the mapper element of the mapper
XML.

--
Guy Rouillier



------ Original Message ------
From: "Poitras Christian" <[hidden email]>
To: "[hidden email]" <[hidden email]>
Sent: 6/21/2016 9:39:09 AM
Subject: Re: Using MyBatisModule :: addMapperClass with Mapper XML File

>Hi,
>
>This is due to an old design decision to simplify things. If you use
>MyBatis alone, it is a good design choice to put the XML and Java code
>side by side since they almost always change together, although MyBatis
>does not force you to do that.
>
>You can add this method to the MyBatisModule on GitHub if you want and
>I will merge it.
>
>Best regards,
>Christian
>
>De :
><[hidden email]<mailto:[hidden email]>>
>on behalf of Asaf Mesika
><[hidden email]<mailto:[hidden email]>>
>Répondre à :
>"[hidden email]<mailto:[hidden email]>"
><[hidden email]<mailto:[hidden email]>>
>Date : Tuesday, June 21, 2016 at 4:06 AM
>À : mybatis-user
><[hidden email]<mailto:[hidden email]>>
>Objet : Using MyBatisModule :: addMapperClass with Mapper XML File
>
>Hi,
>
>After much trial and error we've discovered when you use
>MyBatisModule.addMapperClass() it forces you to create a directory
>chain in src/main/resources which is identical to the directory chain
>(package name) of the mapper class (interface).
>
>This is different from using MyBatisXMLModule where you specify the
>location of the XML file.
>
>What I don't understand is why addMapperClass(type) can't be
>addMappperClass(type, xmlClasspath), allowing you to place this XML any
>where you want just like you can in the config XML file.
>
>
>Any thoughts?
>
>Asaf Mesika
>Loz.io
>
>
>--
>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
>[hidden email]<mailto:[hidden email]>.
>For more options, visit https://groups.google.com/d/optout.
>
>--
>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 [hidden email].
>For more options, visit https://groups.google.com/d/optout.


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Re[2]: Using MyBatisModule :: addMapperClass with Mapper XML File

Asaf Mesika
Guy - this can only be achieved when using the XML file. If you use the programmatic approach, you can't.

Christian - is there anyway to change that ?

On Wednesday, June 22, 2016 at 9:53:33 AM UTC+3, Guy Rouillier wrote:
In a Maven web project, we standardized on putting the XML files (both
config and mapper) in src/main/resources, while the Java files go into
src/main/java.  This is more in keeping with the Maven conventions.  For
simplicities sake, we just put all the XML files in the root directory,
rather than creating the subdirectories reflecting the classpath of the
corresponding Java class.  We specify the full classpath of the Java
class using the namespace attribute of the mapper element of the mapper
XML.

--
Guy Rouillier



------ Original Message ------
From: "Poitras Christian" <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="STm6Oh7HBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">Christia...@...>
To: "<a href="javascript:" target="_blank" gdf-obfuscated-mailto="STm6Oh7HBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybati...@..." <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="STm6Oh7HBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybati...@...>
Sent: 6/21/2016 9:39:09 AM
Subject: Re: Using MyBatisModule :: addMapperClass with Mapper XML File

>Hi,
>
>This is due to an old design decision to simplify things. If you use
>MyBatis alone, it is a good design choice to put the XML and Java code
>side by side since they almost always change together, although MyBatis
>does not force you to do that.
>
>You can add this method to the MyBatisModule on GitHub if you want and
>I will merge it.
>
>Best regards,
>Christian
>
>De :
><<a href="javascript:" target="_blank" gdf-obfuscated-mailto="STm6Oh7HBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybati...@googlegroups.com<mailto:<a href="javascript:" target="_blank" gdf-obfuscated-mailto="STm6Oh7HBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybati...@googlegroups.com>>
>on behalf of Asaf Mesika
><<a href="javascript:" target="_blank" gdf-obfuscated-mailto="STm6Oh7HBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">asaf....@...<mailto:<a href="javascript:" target="_blank" gdf-obfuscated-mailto="STm6Oh7HBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">asaf....@...>>
>Répondre à :
>"<a href="javascript:" target="_blank" gdf-obfuscated-mailto="STm6Oh7HBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybati...@googlegroups.com<mailto:<a href="javascript:" target="_blank" gdf-obfuscated-mailto="STm6Oh7HBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybati...@googlegroups.com>"
><<a href="javascript:" target="_blank" gdf-obfuscated-mailto="STm6Oh7HBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybati...@googlegroups.com<mailto:<a href="javascript:" target="_blank" gdf-obfuscated-mailto="STm6Oh7HBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybati...@googlegroups.com>>
>Date : Tuesday, June 21, 2016 at 4:06 AM
>À : mybatis-user
><<a href="javascript:" target="_blank" gdf-obfuscated-mailto="STm6Oh7HBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybati...@googlegroups.com<mailto:<a href="javascript:" target="_blank" gdf-obfuscated-mailto="STm6Oh7HBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybati...@googlegroups.com>>
>Objet : Using MyBatisModule :: addMapperClass with Mapper XML File
>
>Hi,
>
>After much trial and error we've discovered when you use
>MyBatisModule.addMapperClass() it forces you to create a directory
>chain in src/main/resources which is identical to the directory chain
>(package name) of the mapper class (interface).
>
>This is different from using MyBatisXMLModule where you specify the
>location of the XML file.
>
>What I don't understand is why addMapperClass(type) can't be
>addMappperClass(type, xmlClasspath), allowing you to place this XML any
>where you want just like you can in the config XML file.
>
>
>Any thoughts?
>
>Asaf Mesika
>Loz.io
>
>
>--
>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
><a href="javascript:" target="_blank" gdf-obfuscated-mailto="STm6Oh7HBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybatis-user...@googlegroups.com<mailto:<a href="javascript:" target="_blank" gdf-obfuscated-mailto="STm6Oh7HBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybatis-user+unsubscribe@googlegroups.com>.
>For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.
>
>--
>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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="STm6Oh7HBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybatis-user...@googlegroups.com.
>For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.


---
This email has been checked for viruses by Avast antivirus software.
<a href="https://www.avast.com/antivirus" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.avast.com%2Fantivirus\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFKLvnpDv0lgK5pU3VEfIU9tx2wrg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.avast.com%2Fantivirus\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFKLvnpDv0lgK5pU3VEfIU9tx2wrg&#39;;return true;">https://www.avast.com/antivirus

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Using MyBatisModule :: addMapperClass with Mapper XML File

Asaf Mesika
In reply to this post by Poitras Christian
How can I contribute to the documentation won't look for this hours until found?


On Tuesday, June 21, 2016 at 4:42:12 PM UTC+3, [hidden email] wrote:
On second look, the MyBatis Java configuration seems to force you to keep
the XML and Java file together.
The Configuration class only has one addMapper(Class) method so you cannot
choose the location of the XML file.

This will make it nearly impossible to change the MyBatisModule since it
relies on the Configuration class.


Le 2016-06-21, 9:39 AM, « <a href="javascript:" target="_blank" gdf-obfuscated-mailto="JaWnj9aOBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybati...@... on behalf of
Poitras Christian » <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="JaWnj9aOBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybati...@... on behalf of
<a href="javascript:" target="_blank" gdf-obfuscated-mailto="JaWnj9aOBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">Christia...@...> a écrit :

>Hi,
>
>This is due to an old design decision to simplify things. If you use
>MyBatis alone, it is a good design choice to put the XML and Java code
>side by side since they almost always change together, although MyBatis
>does not force you to do that.
>
>You can add this method to the MyBatisModule on GitHub if you want and I
>will merge it.
>
>Best regards,
>Christian
>
>De :
><<a href="javascript:" target="_blank" gdf-obfuscated-mailto="JaWnj9aOBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybati...@googlegroups.com<mailto:<a href="javascript:" target="_blank" gdf-obfuscated-mailto="JaWnj9aOBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybati...@googlegroups.com>> on
>behalf of Asaf Mesika
><<a href="javascript:" target="_blank" gdf-obfuscated-mailto="JaWnj9aOBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">asaf....@...<mailto:<a href="javascript:" target="_blank" gdf-obfuscated-mailto="JaWnj9aOBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">asaf....@...>>
>Répondre à :
>"<a href="javascript:" target="_blank" gdf-obfuscated-mailto="JaWnj9aOBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybati...@googlegroups.com<mailto:<a href="javascript:" target="_blank" gdf-obfuscated-mailto="JaWnj9aOBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybati...@googlegroups.com>"
><<a href="javascript:" target="_blank" gdf-obfuscated-mailto="JaWnj9aOBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybati...@googlegroups.com<mailto:<a href="javascript:" target="_blank" gdf-obfuscated-mailto="JaWnj9aOBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybati...@googlegroups.com>>
>Date : Tuesday, June 21, 2016 at 4:06 AM
>À : mybatis-user
><<a href="javascript:" target="_blank" gdf-obfuscated-mailto="JaWnj9aOBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybati...@googlegroups.com<mailto:<a href="javascript:" target="_blank" gdf-obfuscated-mailto="JaWnj9aOBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybati...@googlegroups.com>>
>Objet : Using MyBatisModule :: addMapperClass with Mapper XML File
>
>Hi,
>
>After much trial and error we've discovered when you use
>MyBatisModule.addMapperClass() it forces you to create a directory chain
>in src/main/resources which is identical to the directory chain (package
>name) of the mapper class (interface).
>
>This is different from using MyBatisXMLModule where you specify the
>location of the XML file.
>
>What I don't understand is why addMapperClass(type) can't be
>addMappperClass(type, xmlClasspath), allowing you to place this XML any
>where you want just like you can in the config XML file.
>
>
>Any thoughts?
>
>Asaf Mesika
>Loz.io
>
>
>--
>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
><a href="javascript:" target="_blank" gdf-obfuscated-mailto="JaWnj9aOBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybatis-user...@googlegroups.com<mailto:<a href="javascript:" target="_blank" gdf-obfuscated-mailto="JaWnj9aOBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybatis-user+unsubscribe@
><a href="http://googlegroups.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://googlegroups.com&#39;;return true;" onclick="this.href=&#39;http://googlegroups.com&#39;;return true;">googlegroups.com>.
>For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.
>
>--
>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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="JaWnj9aOBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybatis-user...@googlegroups.com.
>For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Using MyBatisModule :: addMapperClass with Mapper XML File

Poitras Christian
Hi,

You can change the files in the src/site/xdoc folder. They are used to generate the web site.
<https://github.com/mybatis/guice/tree/master/src/site/xdoc><https://github.com/mybatis/guice/tree/master/src/site/xdoc>http://github.com/mybatis/guice/tree/master/src/site/xdoc

As for contributing to the project to allow the selection of the XML file location, you would need to fork the MyBatis-3 project first and make a pull request afterwards. Then do the same for MyBatis-Guice.
Although, I am not convinced it is worth your time to add such a feature since I bet that most people who use the Java configuration will either use annotations only (no XML) or have the XML files and Java files in the same package.

Christian

De : <[hidden email]<mailto:[hidden email]>> on behalf of Asaf Mesika <[hidden email]<mailto:[hidden email]>>
Répondre à : "[hidden email]<mailto:[hidden email]>" <[hidden email]<mailto:[hidden email]>>
Date : Wednesday, June 22, 2016 at 4:42 AM
À : mybatis-user <[hidden email]<mailto:[hidden email]>>
Objet : Re: Using MyBatisModule :: addMapperClass with Mapper XML File

How can I contribute to the documentation won't look for this hours until found?


On Tuesday, June 21, 2016 at 4:42:12 PM UTC+3, [hidden email]<mailto:[hidden email]> wrote:
On second look, the MyBatis Java configuration seems to force you to keep
the XML and Java file together.
The Configuration class only has one addMapper(Class) method so you cannot
choose the location of the XML file.

This will make it nearly impossible to change the MyBatisModule since it
relies on the Configuration class.


Le 2016-06-21, 9:39 AM, « [hidden email]<javascript:> on behalf of
Poitras Christian » <[hidden email]<javascript:> on behalf of
[hidden email]<javascript:>> a écrit :

>Hi,
>
>This is due to an old design decision to simplify things. If you use
>MyBatis alone, it is a good design choice to put the XML and Java code
>side by side since they almost always change together, although MyBatis
>does not force you to do that.
>
>You can add this method to the MyBatisModule on GitHub if you want and I
>will merge it.
>
>Best regards,
>Christian
>
>De :
><[hidden email]<javascript:><mailto:[hidden email]<javascript:>>> on
>behalf of Asaf Mesika
><[hidden email]<javascript:><mailto:[hidden email]<javascript:>>>
>Répondre à :
>"[hidden email]<javascript:><mailto:[hidden email]<javascript:>>"
><[hidden email]<javascript:><mailto:[hidden email]<javascript:>>>
>Date : Tuesday, June 21, 2016 at 4:06 AM
>À : mybatis-user
><[hidden email]<javascript:><mailto:[hidden email]<javascript:>>>
>Objet : Using MyBatisModule :: addMapperClass with Mapper XML File
>
>Hi,
>
>After much trial and error we've discovered when you use
>MyBatisModule.addMapperClass() it forces you to create a directory chain
>in src/main/resources which is identical to the directory chain (package
>name) of the mapper class (interface).
>
>This is different from using MyBatisXMLModule where you specify the
>location of the XML file.
>
>What I don't understand is why addMapperClass(type) can't be
>addMappperClass(type, xmlClasspath), allowing you to place this XML any
>where you want just like you can in the config XML file.
>
>
>Any thoughts?
>
>Asaf Mesika
>Loz.io
>
>
>--
>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
>[hidden email]<javascript:><mailto:mybatis-user+unsubscribe@<javascript:>
>googlegroups.com<http://googlegroups.com>>.
>For more options, visit https://groups.google.com/d/optout.
>
>--
>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 [hidden email]<javascript:>.
>For more options, visit https://groups.google.com/d/optout.


--
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 [hidden email]<mailto:[hidden email]>.
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.