In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly describes how to use Hibernate automatic generation tool Schema, the text is very detailed, has a certain reference value, interested friends must read!
Hibernate Schema auto-generation can generate DDL from your mapping file using a Hibernate tool. The generated schema contains integrity reference constraints (primary and foreign keys) for entity and collection class tables. The tables and sequences required by the identifier generator involved are also generated simultaneously.
To use this tool, you must specify a SQL dialect (Dialet) via the hibernate.Dialet attribute, since DDL is highly vendor-dependent.
First, customize your mapping file to improve the resulting Hibernate schema. Customizing the Hibernate schema
Many Hibernate mapping elements define optional length, precision, or scale attributes. You can set the length, precision, and decimal places of the field with this property.
Some tags also accept not-null attributes (used to generate NOT NULL constraints on table fields) and unique attributes (used to generate UNIQUE constraints on table fields).
The unique-key attribute specifies a *** key constraint on a group of fields. Currently, the values specified by the unique-key attribute are not used as the name of the constraint when generating DDL, they are only used to differentiate within the mapping file.
The index attribute generates an index with the corresponding field (s), which indicates the name of the index. If multiple fields correspond to the same index name, an index containing those fields is generated.
The foreign-key attribute can be used to override the name of any generated foreign key constraint.
Many mapping elements also accept child elements. This is especially useful when defining types that span multiple fields.
property>
The default attribute specifies a default value for the field (you should assign the same value to the corresponding attribute before saving a new instance of the mapped class).
property> property>
The sql-type attribute allows the user to override the default Hibernate type to SQL data type mapping.
property>
The check attribute allows the user to specify a constraint check.
property> ... class> The above is "Hibernate automatic generation tool Schema how to use" all the content of this article, thank you for reading! Hope to share the content to help everyone, more relevant knowledge, welcome to pay attention to the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.