问题
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