如何安裝並使用hibernate tools

來源:互聯網
上載者:User

標籤:blog   http   使用   檔案   資料   2014   

參考資料:http://radiumwong.iteye.com/blog/358585

              http://linjia880714.iteye.com/blog/859334

Hibernate Tools可以通過訪問已經建立好的資料庫以反向工程方式產生POJO檔案。
今天就來說一下如何使用Hibernate Tools來產生POJO。

1、首先,要去Hibernate的網站下載這個工具包。一個大約14M的ZIP壓縮檔。
http://jaist.dl.sourceforge.net/sourceforge/jboss/HibernateTools-3.2.4.Beta1-R200810311334.zip


2、解壓縮下載好的檔案,釋放出features和plugins這兩個檔案夾和其中的內容。完成後將這兩個檔案夾複製到Eclipse的目錄下(這兩個檔案夾在Eclipse中是預設存在的,直接複製就行了)。

3、到這步為止HibernateTools的安裝就算結束了,下面開始配置和具體使用。一開始選擇工程下的SRC目錄,然後右鍵New->Other->Hibernate->Hibernate Configuration File(cfg.xml),在彈出的視窗中選擇Next ,進入到下面的選項中。

driverClassName="com.mysql.jdbc.Driver"

url="jdbc:mysql://localhost:3306/histopdb_release?autoReconnect=true&autoReconnectForPools=true&useunicode=true&characterEncoding=utf8"


4、選擇Eclipse的下拉式功能表Window->Show View->Other->Hibernate->Hibernate Configurations,現在就可以查看Hibernate的配置視窗了。在視窗中單擊右鍵Add Configuration,出現Edit Configuration視窗。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.