Improve database schema

Source: Internet
Author: User

Improve database schema
Hibernate reads the ing metadata of your java model class and generates schemaDDL statements. You can export them to a text file, or execute them directly in the database when inheriting the test run. Because most database schema languages have product features, you need to keep in mind that every option you add to the ing metadata has the potential to be bound to a specific database.

Hibernate automatically creates a basic schema for your tables and constraints. It even creates a sequence based on the primary key generation method you choose. However, there are some schema Features that hibernate will not automatically create. This includes all advanced database product features and other features related to physical storage data, such as tablespace. in addition, your DBA will often add some additional schema statements to improve your schema. DBAs should be involved in early stage and determine the schema automatically generated by hibernate. you cannot deploy the automatically generated schema to the product without any check.

If your product development steps permit, DBA changes can be fed back to your JAVA System to add ing metadata. In many projects, the ing metadata can include the necessary schema changes for all DBA modifications. Then, hibernate can automatically generate the final schema of all products, including comments, constraints, and indexes.

In the next section, we will show you how to customize the generated schema and how to add free database schema components. We will discuss custom data types, additional consistency rules, indexes, and how to replace the schema automatically generated by hibernate.

Export the schema basic file to a file

Hibernate binds the org. hibernate. tool. hbm2ddl and SchemaExport class to the main () method. You can run the command line. This helper can directly talk to your database and create a schema or write a text file so that your DBA can perform custom optimization and improvement.

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.