We have the main mysql database, for which all applications in our organization need data in this database. How can I configure my java application to use this database with this particular database when I use Spring and Hibernate in my application? How do I set up JPA annotations, for example, between the CONTRACT table in my database and the COUNTRY table in our main database? What is the best practice for this?
The best practice is not to use multiple databases.
2 DataSource SessionFactory/EntityManagerFactory + persistnece, , .
DataSource
SessionFactory
EntityManagerFactory
:
Source: https://habr.com/ru/post/1740101/More articles:What happens first? Does anyone know how the Apache server will handle this request? - securitySetting a registry value based on a dialog in a visual studio setup project - visual-studio-2008Why does PHP5 SQLite PDO fail silently when connecting a database? - phpVariable memory address - variablesесли условие в диаграмме класса uml? - classUIButton Disclosure Indicator - iphoneGood suggestions for learning OOP PHP - oopDOM: how to import nodes and provide them with another namespace prefix - domImport .dll into Qt - c ++Plugin Prototype / Scriptaculous Cycle (Slideshow) - prototypejsAll Articles