My team is looking to use the Hibernate ORM in a new Java server we are developing for our product.
We allow clients to extend our database schema by adding their own custom columns. The columns are added at runtime, and they are added directly to the underlying database table, i.e. the schema is changed. Data specifying the schema changes are stored in a separate table, detailing the affected tables/columns.
Ultimately, we cannot specify the custom columns via JPA annotations because they are not known at compile time, but we still need to CRUD these columns. We would like to use all of Hibernate’s underlying niceties to handle the reads and writes.
What’s the proper way to do this in modern Hibernate? We saw that in the old HBM file format there is a certain that (sort of) meets our needs, but we also understand that HBM is deprecated. We’d appreciate any pointers.