Most likely your persistence.xml file has property hibernate.hbm2ddl.auto set to create or create-drop which means that whenever you build EntityManagerFactory will reset your data base by rebuilding schema. Change that to update and your problem will disappear (in all described cases).
HTH