This is not really a issue but it is a sometimes annoying thing during my development. Let's say I have some entities (db is created according those entities, not otherwise) and I decided to add a column, drop a column or something and now I need to commit those changes to my DB.
What is the best way to do that? I sometimes have to restart Glassfish; sometimes deploying it is enough; sometimes I need to erase tables manually because restarting won't help. My strategy in persistence.xml
is set to Create
but other options didn't really help me.
Is there any standard approach for commiting changes from entities to database?