Database rework with JPA + Hibernate + Liquibase
Overview
This PR replaces the database layer with intentional breaking changes. The aim is to modernize the architecture in some places.
Issues get maybe be fixed
Fixes #3573 Fixes #3274 Fixes #3573 Fixes #4128 Fixes #4105 Fixes #4612 Fixes #2994 Fixes #4732 Fixes #2963 Fixes #4326 Fixes #3237 Fixes #3287 Fixes #4386 Fixes #2273
Description
This PR replaces the current database layer with a combination of JPA, Hibernate, ~Flyway~LiquiBase, and Hikaricp. The use of Flyway is intended to ensure that an update to PlotSquared v8 is possible without data loss.
The design pattern repository was used extensively to enable testability. Named queries were also used to maintain high maintainability. Staying on the topic of queries, we use HQL (Hibernate Query Language) to enable users to also use other database types that are not supplied by PlotSquared as standard, e.g., h2, Postgresql, MS SQL, Oracle.
~Flyway serves as a tool for making database schema changes in the future, allowing us to enforce third normal form in an 8.1 version to further flatten data handling and prevent problems.~
Open to-dos:
- [x] Restoration of the database migration command
- [ ] Migration from v7 to v8 database structure
- [ ] JUnit tests with and without TestContainers
- [x] Replacing the DBFunc class with a clean service layer
- [x] Testing all database functions
- [ ] Testing Bakery test data
- [ ] (Make beta/alpha test available to the community)
- [ ] Discuss how we can get the jar size issues under control ~- [ ] (Improve StorageSQL configuration with https://commons.apache.org/proper/commons-configuration/)~
- [X] Integrate HikariCP
- [ ] (After implementation of async calls)
Submitter Checklist
- [X] Make sure you are opening from a topic branch (/feature/fix/docs/ branch (right side)) and not your main branch.
- [X] Ensure that the pull request title represents the desired changelog entry.
- [X] New public fields and methods are annotated with
@since TODO. - [X] I read and followed the contribution guidelines.
Given this produces a ~52M jar, this cannot be considered to be merged or reviewed.
There are possiblties to reduce the jar size
Please take a moment and address the merge conflicts of your pull request. Thanks!