You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mybatis-user
Hello!
Is it possible to specify different package (and different source
base) for particular tables when generating model and client code?
The database connection settings are the same for all tables.
I have multi-module maven project, and some entities reside in
different sub-modules.
I found the only way - to specify different contexts for the tables,
however this leads to duplication of jdbcConnection /
javaModelGenerator / sqlMapGenerator with differences in few
attributes.
Perhaps there is some approach with less copy/paste implied?
Steve Hill
unread,
Nov 12, 2012, 9:22:12 PM11/12/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mybati...@googlegroups.com
Hi,
That is exactly how we did it. The jdbc connection etc is defined by properties so we did not think it was a big deal to have multiple context elements.
Thanks!
Steve.
Sent from my iPhone
Jeff Butler
unread,
Nov 12, 2012, 9:28:06 PM11/12/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mybati...@googlegroups.com
You can write a plugin to change the package for every table. See the source for the RenameExampleClass plugin for a good starting point.
Changing the source base is not possible with a plugin - you'll need to use different contexts for that.