The mapping file for hibernate when using the Oracle database and the MySQL database. Different hbm.xml

Source: Internet
Author: User

If you are using an Oracle database, then hibernate's mapping file. Hbm.xml is as follows:

<id name= "Xuehao" column= "Xuehao" >

</id>

This ID is not generated automatically by the database, which needs to be noted, and the fields must correspond to the entity class, and the corresponding get () method and set () method are also required in the entity class.

Because the IDs in the Oracle database are automatically generated, there is no need to write the ID of the database, which is very different from the MySQL database, and the MySQL database must specify the ID when the table is built, while Oracle does not, when inserted, Both MySQL and Oracle databases can be used without specifying an ID.

The mapping file for hibernate when using the Oracle database and the MySQL database. Different hbm.xml

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.