Using mybatis in SpringBoot with complex data source .
-
first of all , we need to design our ER map in two databse :
we use mysql workbench to finish the job :
add two scheme , named test1 and test2
in test1 , we have user and shipping_address table
in test2 , we have order table
-
now , we need to export our table sql :
also use mysql workbench to finish that :
-
finaly , create the test database in mysql :
simply finish the job by running the table.sql :
because we have two database to connect
so there are two mybatis-generator config file named generatorTest1.xml and generatorTest2.xml in complex-service resources .
for more detail , plz enter complex-service folder .