How to do ORM using reverse engineering in Hibernate in Intellij IDEA?

纵饮孤独 提交于 2019-12-23 17:12:19

问题


I have 100 tables and most of them have average 40-50 fields. Some table have 5-6 fields, so I can make it's object relational mapping easily with DB.

But I have so many numbers of tables as well as fields so Is it possible to create ORM using reverse engineering in Intellij IDEA ?

If yes then how to do so ?

I have done mapping simple like :

@Entity
@SequenceGenerator(name = "sequence", sequenceName = "pat_id_seq")
@Table(name = "pat")
public class Patron extends BaseEntity {

    @Column(name = "p_id")
    private String pID;

    @Column(name = "user_password")
    private String userPassword;
}

I am using PostgreSQL as a DB provider.

So any help on it to so fast ?

Help..


回答1:


I'm sure you have figured it out by now...but for anyone else trying to resolve this. If you have added plugin support and it is enabled (check boxed) do the following as well.

Right click on your project "Add Framework Support..." --> Scoll down to JAVA EE Persistence. At that point you will see the Persistence option in "View --> Tool Windows --> Persistence".




回答2:


open the persistence tool window, then click generate persistence mapping.

View > Tool Windows > Persistence



来源:https://stackoverflow.com/questions/22293958/how-to-do-orm-using-reverse-engineering-in-hibernate-in-intellij-idea

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!