Improving schema DDL { @JoinColumn(name = “CATEGORY_ID”, columnDefinition = “char(32)”) } ) Private Set categories = new HashSet(); … } You have to use one Hibernate extension to name the nonstandard identifier generator. All other customizations of the generated SQL DDL are done with annotations of the JPA specification. One attribute deserves special attention: The columnDefinition isn t the same as sql-type in a Hibernate mapping file. It s more flexible: The JPA persistence provider appends the whole string after the column name in the CREATE TABLE statement, as in ITEM_ID char(32). Customization of names and data types is the absolute minimum you should consider. We recommend that you always improve the quality of your database schema (and ultimately, the quality of the data that is stored) with the appropriate integrity rules. 8.3.2 Ensuring data consistency Integrity rules are an important part of your database schema. The most important responsibility of your database is to protect your information and to guarantee that it s never in an inconsistent state. This is called consistency, and it s part of the ACID criteria commonly applied to transactional database management systems. Rules are part of your business logic, so you usually have a mix of business- related rules implemented in your application code and in your database. Your application is written so as to avoid any violation of the database rules. However, it s the job of the database management system to never allow any false (in the business logic sense) information to be stored permanently for example, if one of the applications accessing the database has bugs. Systems that ensure integrity only in application code are prone to data corruption and often degrade the quality of the database over time. Keep in mind that the primary purpose of most business applications is to produce valuable business data in the long run. In contrast to ensuring data consistency in procedural (or object-oriented) application code, database-management systems allow you to implement integrity rules declaratively as part of your data schema. The advantages of declarative rules include fewer possible errors in code and a chance for the database-management system to optimize data access.
Searching for affordable and reliable webhost to host and run your web applications? Go to our java web server services and you will be pleased.
This entry was posted
on Thursday, March 13th, 2008 at 10:09 am and is filed under PHP5.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.