Hibernate (4) _ Reverse create a Domain object and object relationship ing file from the table,

Source: Internet
Author: User

Hibernate (4) _ Reverse create a Domain object and object relationship ing file from the table,

We used to write.Domain objectAndObject link ing File-> Then generateTable.

Now, we will first build a database.Table-> GenerateDomain objectAndObject link ing File.

Steps:

1. Create a web Project

2. Provided by myeclipseDatabase BrowserConnect to our database.

① Create a database connection:

 

② Configure the database connection (Here we use an oracle image, followed by the configuration under the SQL server database, which can be ignored without affecting ):

Fill in the driver information here and introduce the driver package.

③ Enter the logon password to enter the database after the operation is successful:

Right-click a table to directly modify and delete the table. Of course, this is equivalent to directly modifying the data in the database. For example, edit data can be directly operated on the table.

You can also use SQL statements to perform operations:

3.IntroductionHibernate Development KitAnd automatically create the hibernate. cfg. xml file.

 

 

After the above database connection is introduced into the driver, the driver configured previously can be matched here.

4. Below we useReverse Engineering,Automatic CreationDomain class and object relationship ing File.

Java object (attribute) <--------- 1. java type 2. hibernate types -------------> table field type (two matching types, common java matching types)

After the reverse engineering is completed, a pojo object and an object ing file are generated.

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.