Reputation: 18861
I have an application full of real data. I'd like to provide aministrator interface, who can add new columns, indexes and so on to database tables.
But of course there are already data inserted. Can I somehow dynamically add new fields to mapping classes and remap it on runtime? So I don't have to stop server, recompile, deploy and start it again?
Or is this too low-level thing to do with Hibernate?
Upvotes: 4
Views: 905
Reputation: 3679
As far as I experimented trying to solve similar problem once, you can only perform a new Configuration#configure during runtime -> build a new SessionFactory out of it -> create new Sessions having the new configuration reflected. This solution worked fine. However, I found no solution how to propagate these changes to an existing SessionFactory instance.
Upvotes: 2