Playframework Play框架中多个数据库的多个演进

Playframework Play框架中多个数据库的多个演进,playframework,Playframework,我有两个要存储对象的数据库,每个数据库都是互斥的 数据库1的对象1 数据库2的对象2 是否有一种方法可以自动“映射”或“指示”每个模型在进化过程中放入哪个数据库,以便创建两个不同的数据库连接 db.default.driver="com.mysql.jdbc.Driver" db.default.url="jdbc:mysql://localhost:3600/db_name1" db.default.user="username" db.default.password="password"

我有两个要存储对象的数据库,每个数据库都是互斥的

数据库1的对象1 数据库2的对象2


是否有一种方法可以自动“映射”或“指示”每个模型在进化过程中放入哪个数据库,以便创建两个不同的数据库连接

db.default.driver="com.mysql.jdbc.Driver"
db.default.url="jdbc:mysql://localhost:3600/db_name1"
db.default.user="username"
db.default.password="password"

db.otherDBName.driver="com.mysql.jdbc.Driver"
db.otherDBName.url="jdbc:mysql://localhost:3306/db_name2"
db.otherDBName.user="username"
db.otherDBName.password="password"

//then you let ebean know where to find the models
ebean.default="models.*"
ebean.otherDBName="otherDB.models.*"

//you can refer to the otherDBName with 
Ebean.getServer("otherDBName").save(object);