Improve database Schema

Source: Internet
Author: User

This address: http://blog.csdn.net/sushengmiyan/article/details/50422102

This paper mattered meters along

Hibernate reads The mapping metadata for your Java model class and generates SCHEMADDL statements. You can export them to a text file, or execute them directly in the database when you inherit the test run. Because most database schema languages have product features, you need to keep in mind that every option you add to the mapping metadata has the potential to bind to a particular database.

Hibernategive your tables and constraints the automatic creation of basicSchemaIt will even create a sequence based on the primary key generation you choose. But there are someHibernateis not automatically createdSchemafeature. This includes features of all advanced database product features and other physical storage data, such astablespace.In addition, yourDBAwill often add a few extraSchemastatement to improve yourschema. DBAsshould be involved and determined early onHibernateAuto-generatedschema.never allow automatic generation without a checkSchemadeploy to the product.

If your product development steps allow,DBA changes can be fed back into putting your JAVA system, adding mapping metadata. In many projects, mapping metadata can include The necessary schema changes for all DBA modifications . Hibernate can then automatically generate the final schema for all products , including annotations, constraints, indexes, and so on.

In the next section, we show you how to customize the generated schema and how to add free database schema components, we discuss custom data types, additional consistency rules, indexes, and how to replace Hibernate Auto-generated schema.

Export the schema base file to a file

Hibernate binds the org.hibernate.tool.hbm2ddl,schemaexport class to the Main method main (), You can run it from the command line. This helper can be directly with your database session and create A schema or write a text file so that your DBA can perform custom optimization improvements.

Improve database Schema

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.