Hibernate Tools with Eclipse

>>> install hibernate tools in eclipse


> select eclipse menu 'Help' - 'Install New Software...' to open a dialog and add the new site http://download.jboss.org/jbosstools/updates/stable/ to install/update hibernate tools as follows.

 

> eclipse will auto link to the site to show you the plug-ins you can install/update

 

> select hibernate tools to install

 

>>> generate hibernate configuration files with hibernate tools
 
> Pre-condition : database is ready and tables are created already.
> open perspective for hibernate tools in eclipse

 

> right click the work-place and select 'Add Configuration...' to open 'Edit Configuration' dialogue.

 

> click 'Setup...' button to add a new configuration file .cfg.htm

 

 

> specify the file name and path

 

> specify the database and connection parameters,etc.

 

> specify the database dialect

 

> then this tool will generate hibernate_web.cfg.xml in folder /enotebook/config

 

>>> generate source code with hibernate tools
 
> click 'Run As...' button in the toolbar and select 'Hibernate Code Generation Configurations...'

 

 

> right click the menu on the left column and select 'New' to create a hibernate console

 

>  take note the 'Reserve engineer from JDBC Connection' should be selected.

 

 

then click Run button and you will find some files generated in /enotebook/tmp folder

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章