There are several java SE apps using the same library and working with the same database via Hibernate (not JPA). Where do I put hibernate mapping files and hibernate config? (so what can be extracted to the library?)
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Put everything that is common to all applications in the library, and everything related to a specific application (database URL, user, password, but maybe also caching options, etc.) outside of the library.
At then end, everything is loaded from the classpath. Whether the files are in one jar or another doesn’t matter for Hibernate.
If you use annotations, most of the configuration will be in the entity classes anyway.