Workaround for Hibernate Unable to select Spring DAO type in reverse engineering "updated version"

Source: Internet
Author: User

Directory (?) [+]

It programmer development Essentials-all kinds of resources download list, history of the most IT resources, personal collection summary.


One of the previous articles (Hibernate reverse engineering step and DAO type cannot select Spring DAO workaround) mentions that for hibernate to be unable to select Spring DAO type in reverse engineering, just select the project right-click Properties, MyEclipse, Spring, fill in the XML at config file extensions, then click Add, Select Spring's general profile according to the directory Applicationcontext.xml can, but today again encounter such a problem, found that this method is not effective to solve, and the last record of the only difference is that when writing an article, the use of MyEclipse Version 6.0, which was developed using the MyEclipse6.5 version.

In fact, the method mentioned above is only a visual operation on the surface, the essence is that Springbeans failed to find the corresponding mysessionfactory, so for the MyEclipse6.5 version, we need to do the following two ways to configure:

Method One, select the project, Properties, MyEclipse, Spring-Beans, fill in the XML at configurration file suffixes, then click Add, Find the directory where the mysessionfactory XML file is located, such as: Webroot\web-inf\applicationcontext.xml, and then step through the directory selection.

Method Two, locate the file. Springbeans (under the project root, or search for the string springversion in the project), and add code to it:

<config>WebRoot\WEB-INF\applicationContext.xml</config>

After the add is complete, the code for the configuration file is as follows:

< XML version= "1.0" encoding= "UTF-8"?>

<beansprojectdescription>

<configextensions>

<configextension>xml</configextension>

</configextensions>

<configs>

<config>WebRoot\WEB-INF\applicationContext.xml</config>

</configs>

<configsets>

</configsets>

<springversion>2.0</springversion>

</beansprojectdescription>

At this point, when we reverse-engineer a table in the database, we can re-select the spring DAO Type selection, and the steps for how to reverse-engineer hibernate can refer to the record mentioned at the beginning of this article.

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.