spring_reference/IX. ‘How-to’ guides/68.1. Initialize a database...

7 lines
417 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

### 68.1. 使用JPA初始化数据库
JPA有个生成DDL的特性这些可以设置为在数据库启动时运行。这可以通过两个外部属性进行控制
- `spring.jpa.generate-ddl`boolean控制该特性的关闭和开启跟实现者没关系
- `spring.jpa.hibernate.ddl-auto`enum是一个Hibernate特性用于更细力度的控制该行为。更多详情参考以下内容。