如何从数据库中生成对象@实体? [英] How to generate object @Entities from database?
问题描述
我想从数据库生成JPA的 @Entity
s(但我希望它是面向对象的)。例如
@Entity
@Table(name =badges)
public class Badges implements Java .io.Serializable {
私人整数ID;
私人用户用户;
私人字符串名称;
私人字符串日期;
如果它支持ManyToOne,OneToMany,Parent和ManyToMany,它将会很酷。
PS我尝试了JBoss Tools(Hibernate Tools),但我并没有为我工作。 解决方案
使用 JBoss Tools (以前称为hibernate工具)。
来自他们的网站的引用:b
$ b
逆向工程:Hibernate Tools最强大的功能是一个数据库逆向工程工具,可以生成域模型类和Hibernate映射文件,
带注释的EJB3实体bean ,HTML文档甚至整个JBoss Seam应用程序!
I want to generate JPA's @Entity
s from database (but I want it to be object oriented). for Example
@Entity
@Table(name = "badges")
public class Badges implements java.io.Serializable {
private Integer id;
private User user;
private String name;
private String date;
It would be cool if it also support ManyToOne, OneToMany, Parent and ManyToMany.
P.S. I tried JBoss Tools(Hibernate Tools) and I did not work for me.
Use JBoss Tools (formerly hibernate tools).
Quote from their site:
Reverse Engineering: The most powerful feature of Hibernate Tools is a database reverse engineering tool that can generate domain model classes and Hibernate mapping files, annotated EJB3 entity beans, HTML documentation or even an entire JBoss Seam application in seconds!
这篇关于如何从数据库中生成对象@实体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!