Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/hibernate/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 带有hibernate和spring引导的Sqlite_Java_Hibernate_Jpa_Spring Boot_Sqlite - Fatal编程技术网

Java 带有hibernate和spring引导的Sqlite

Java 带有hibernate和spring引导的Sqlite,java,hibernate,jpa,spring-boot,sqlite,Java,Hibernate,Jpa,Spring Boot,Sqlite,我正在使用maven、hibernate、spring和sqlite3进行一个项目。对于连接和hibernate的配置,我使用application.yml文件,它是: spring: profile: dev jpa: hibernate: ddl-auto: create-drop properties: hibernate: dialect: org.hibernate.dialect.SQLiteDialect datasource:url: jdbc:sqlite:C:\User

我正在使用maven、hibernate、spring和sqlite3进行一个项目。对于连接和hibernate的配置,我使用application.yml文件,它是:

spring: 
profile: dev 
jpa:
hibernate:
ddl-auto: create-drop 
properties:
hibernate:
dialect: org.hibernate.dialect.SQLiteDialect
datasource:url: jdbc:sqlite:C:\Users\user pc\Desktop\database\testrest.db
username: username
password: password
driverClassName: org.sqlite.JDBC
每次启动应用程序时,我的sqlite数据库都会被覆盖(因此我会丢失所有表),并创建一个同名的新表


希望得到您的帮助,提前谢谢。

Hibernate的ddl auto的可能值列表如下:

  • 验证:验证架构,不更改数据库
  • 更新:更新模式
  • 创建:创建模式,销毁以前的数据
  • create drop:创建架构,然后在显式关闭
    SessionFactory
    时(应用程序关闭)将其删除
您应该将创建放置替换为更新或验证