customize namespace

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

customize namespace

Xyz Amos

 when   javaClientGenerator is not given, can we customize the namespace of <mapper> tag in the xml? Now the value is targetPackage+tableName+'Mapper'.
And <table> has mapperName attribute which will be appended to the target package.
But what if my xml mapper file and custom mapper interface are not int the same package?

--
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
|  
Report Content as Inappropriate

Re: customize namespace

Jeff Butler
You will need to write a plugin to do this.  Use this one as a starting example:


In the initialized method, I believe you can call either introspectedTable.setMyBatis3JavaMapperType or introspectedTable.setMyBatis3FallbackSqlMapNamespace to change the namespace that will be generated in the XML file.

Jeff Butler


On Tue, Mar 28, 2017 at 10:25 PM Xyz Amos <[hidden email]> wrote:

 when   javaClientGenerator is not given, can we customize the namespace of <mapper> tag in the xml? Now the value is targetPackage+tableName+'Mapper'.
And <table> has mapperName attribute which will be appended to the target package.
But what if my xml mapper file and custom mapper interface are not int the same package?

--
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
|  
Report Content as Inappropriate

Re: customize namespace

Xyz Amos
great thanks!

2017-03-29 23:30 GMT+08:00 Jeff Butler <[hidden email]>:
You will need to write a plugin to do this.  Use this one as a starting example:


In the initialized method, I believe you can call either introspectedTable.setMyBatis3JavaMapperType or introspectedTable.setMyBatis3FallbackSqlMapNamespace to change the namespace that will be generated in the XML file.

Jeff Butler


On Tue, Mar 28, 2017 at 10:25 PM Xyz Amos <[hidden email]> wrote:

 when   javaClientGenerator is not given, can we customize the namespace of <mapper> tag in the xml? Now the value is targetPackage+tableName+'Mapper'.
And <table> has mapperName attribute which will be appended to the target package.
But what if my xml mapper file and custom mapper interface are not int the same package?

--
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 a topic in the Google Groups "mybatis-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mybatis-user/2txttH4dlbA/unsubscribe.
To unsubscribe from this group and all its topics, 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.
Loading...