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.
Generate a database entityClick Code | Generate or press Alt+Insert . Select the entity that you want to generate and press Enter .
Right-click the JPA project in the Project Explorer and select JPA Tools > Generate Entities from Tables. On the Select Tables page of the Generate Entities from Tables wizard, select your database connection and schema. To create a new database connection, click Add connection.
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!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With