dynamic tables and columns with hibernate and/or JPAContainer

Hello everyone,

I know that my issue is not necessarily vaadin related; I was hoping that there might be a vaadin based solution, though.
We inspect different materials with different machines. The only thing they have in common is that the results of these measurements are stored in one database. We have several programs which read data from that database and do various calculations with it. Unfortunately these programs are rather hard to understand and some are even closed source.

Therefore we would like to write a Vaadin-Application to get a “Visual-Front-End” to that database. We decided on Hibernate to connect to, and map the database. This is actually working quite well. The only drawback we encountered so far, is that once a measurement is tweaked it can happen that a new table or/and column is added to that database. Since this process is not controlled by our Vaadin-Application it doesn’t know about it.
Rewriting and deploying the whole application every time the database structure changes is not an option. So I thought we might be able to use the databases own INFORMATION_SCHEMA to find out what columns have changed/were added.

The Problem is, how can I “map” these information on runtime. I haven’t found a clean solution with pure hibernate so I was hoping that “JPAContainer” can help. Does anyone know how this could be achieved? Either with JPAContainer or hibernate…

Is there a different approach I could try?
Any help will be appreciated.

Thanks,
Chris

Hi,

To me it sounds like no ORM is suitable for your needs (dynamic DB schema). That pretty much rules out Hibernate and JPAContainer :frowning: You should somehow be able to create you entity classes dynamically.

It might be better option for your particular case to look at SQLContainer.

cheers,
matti