Java Hibernate在启动时删除表的所有内容,即使hbm2ddl.auto设置为update

Java Hibernate在启动时删除表的所有内容,即使hbm2ddl.auto设置为update,java,hibernate,jpa,Java,Hibernate,Jpa,我没有任何错误,当程序启动时,表是空的 hibernate.cfg.xml: org.sqlite.JDBC jdbc:sqlite:data/javabot.db org.hibernate.dialogue.sqlitedialogue 更新 persistence.xml org.hibernate.jpa.HibernatePersistenceProvider SessionFactory创建: Configuration cfg=新配置(); configure(“hiber

我没有任何错误,当程序启动时,表是空的

hibernate.cfg.xml:


org.sqlite.JDBC
jdbc:sqlite:data/javabot.db
org.hibernate.dialogue.sqlitedialogue
更新
persistence.xml


org.hibernate.jpa.HibernatePersistenceProvider
SessionFactory创建:

Configuration cfg=新配置();
configure(“hibernate.cfg.xml”);
final ServiceRegistry registry=new StandardServiceRegistryBuilder().configure(“hibernate.cfg.xml”).build();
sessionFactory=cfg.buildSessionFactory(注册表);

附加说明:我使用JDA,当JDA完成加载时,表内容立即被删除

将会话工厂中的行更改为:validate@Mateusz是的,但不是,hbm2ddl.auto的目标是自动创建表,并验证它们是否存在