Spring Boot configuration file Application.properties Property resolution

Source: Internet
Author: User

1.JPA naming Policy

Spring.jpa.hibernate.naming-strategy = Org.hibernate.cfg.DefaultNamingStrategy

There are two types of values that can be configured:

Second: Org.hibernate.cfg.ImprovedNamingStrategy  
Defaultnamingstrategy This direct mapping, do not do too much processing (if not set @table, @Column and other attributes). If there is a @column, the @column is the  improvednamingstrategy table name, the field is lowercase, and when there is a capital letter, it is converted to the separator symbol "_".  

Reference Address: http://blog.csdn.net/linxingliang/article/details/52566896

DDL execution Policy for 2.hibernate

Spring.jpa.hibernate.ddl-auto=update

There are 5 types of values you can configure

①create

If set to this value, the previously created table is deleted each time hibernate is loaded (exactly when the sessionfactory is created) and the table is rebuilt according to the model, even if there are no changes in the front and back tables, which often results in database data loss, use this value sparingly

②create-drop

Similar to create, the difference is that every time the sessionfactory is closed, all tables are deleted

③update

This value is more commonly used, you need to establish a database, the first time you load hibernate will automatically create the table, and later create Hibernate will automatically update the table structure according to model, even if the table structure changes, the previous row will not be deleted

④validate

Each time hibernate is loaded, validation creates a database table structure that is only compared to tables in the database and does not create new tables, but inserts new values

3. An error occurred while initializing the database, do not stop

Spring.datasource. continue-on-error=false

The default value is False

4.

Spring Boot configuration file Application.properties Property resolution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.