0
如果我有兩個會話工廠,這意味着我在我的應用程序中使用了兩個數據庫模式,那麼它是否需要兩個配置文件?兩個會話工廠需要多少個配置文件?
如果我有兩個會話工廠,這意味着我在我的應用程序中使用了兩個數據庫模式,那麼它是否需要兩個配置文件?兩個會話工廠需要多少個配置文件?
您只需要一個配置文件。只需添加像這樣的多個會話工廠:
<session-factory name="firstdatasource">
<property name="datasource">my/first/datasource</property>
<mapping resource="..."/>
..
</session-factory>
<session-factory>
<property name="datasource">seconddatasource</property>
..
</session-factory>