Hibernate pojo 코드 생성기 사용 방법

less than 1 minute read

썩 좋지는 않다.

완전 자동화까지는 멀엇다. xml생성은 되지만 어노테이션은 안된다.


1. Download hibernate tools, only tools. From this tutorial in mkyong.com to install hibernate tools.

2. Create a java project ‘HibernateExample’.

3. Do the steps mentioned in mkyong.com to generate the code from with hibernate.

4. Select the jar file (ojdbc.jar) from lib folder of apache tomcat if required.

5. Click on ‘Test Connection’ and confirm that you’ve configured it properly.

6. Create the hibernate.cfg.xml. Enter the fields you know and leave the others blank.

7. Click Apply and then click ‘OK’ to close the dialog box.

8. Now in the hibernate perspective you can list out you database.

9.Choose “Hibernate Code Generation Configuration” from the tool bar. This is the phase where you generate the hibernate.reveng.xml file. Set-up a new hibernate.reveng.xml file. If you are new you could use the UI for specifying, otherwise you could write your own.

mine looks like