[Turn]hibernate to generate hbm.xml and bean classes in Eclipse's reverse engineering

Source: Internet
Author: User

Original address: http://www.xuebuyuan.com/210489.html

In the past has been used myelipse, in MyEclipse do hibernate reverse engineering is very handy.

But recently switched to eclipse, the beginning is not installed Eclipse plug-ins, tossing a few days finally installed, but will not use the disease reverse engineering

Finally found on a foreign site:

http://iablog.sybase.com/paulley/2009/02/reverse-engineering-sql-anywhere-with-hibernate-tools-part-trois/

I will introduce how to generate Hbm.xml and class methods:

Pre-conditions

1, has a project and has added Hibernate 3.x

2, there is a corresponding database. Just not linked up.

And then it's officially started.

1, add Hibernate.cfg.xml

Right-click the project-->new-->other---> Search (Hibernate) and select Hibernate Configuration File (cfg.xml)-->next--> Select the project name-->next--> fill in the necessary information to connect to the database-->finish

Figure:

2. Add Hibernate configuration:

Click Project-->new-->other---> Search (Hibernate)-and select Hibernate Console Configuration. The following interface will appear

3, added: Hibernate.reveng.xml

Right-click the project-->new-->other---> Search (Hibernate) and select Hibernate Reverse Engineering File (reveng.xml)-->next.

will appear as:

After completing the above steps, it will be created and opened: Hibernate.reveng.xml, do the following

Once added, save, close.

4, generate hbm.xml and beans.

Can only be seen in hinbernate mode.

In the specified directory we can see the generated file.

The error is because the package location is not specified: Open the file and add it.

Here the Lord is: as package com.polaris.fw.crud.test

[Turn]hibernate to generate hbm.xml and bean classes in Eclipse's reverse engineering

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.