> For the complete documentation index, see [llms.txt](https://jack80342.gitbook.io/spring-boot/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jack80342.gitbook.io/spring-boot/ix.-how-to-guides/80.-database-initialization/80.1-initialize-a-database-using-jpa.md).

# 80.1 使用JPA初始化数据库

JPA有个生成DDL的特性，并且可以设置为在数据库启动时运行，这可以通过两个外部属性进行控制：

* `spring.jpa.generate-ddl`（`boolean`）控制该特性的关闭和开启，跟实现者没关系。
* `spring.jpa.hibernate.ddl-auto`（`enum`）是一个Hibernate特性，用于更细力度的控制该行为。更多详情参考以下内容。
