如何在Intellij IDEA的Hibernate中使用逆向工程来实现ORM? [英] How to do ORM using reverse engineering in Hibernate in Intellij IDEA?

查看:714
本文介绍了如何在Intellij IDEA的Hibernate中使用逆向工程来实现ORM?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有100张桌子,其中大部分都有平均40-50场。
某些表格有5-6个字段,所以我可以很容易地将它与DB进行对象关系映射。



但是我有很多表格以及字段so是否可以在Intellij IDEA中使用逆向工程创建ORM?



如果是,那么该怎么做?



我做了如下简单映射:

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

@Column(name =p_id)
private字符串pID;

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

我使用PostgreSQL作为数据库提供者。



所以对它的帮助如此之快?

帮助..

解决方案

我相信你现在已经知道了......但对于其他人试图解决这个问题。
如果您已经添加了插件支持并且已启用(复选框),请执行以下操作。



右键单击您的项目添加框架支持.. 。 - >将JAVA EE持久性降到最低。此时,您将在查看 - >工具窗口 - >持久性中看到持久性选项。


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..

解决方案

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".

这篇关于如何在Intellij IDEA的Hibernate中使用逆向工程来实现ORM?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆