How do I generate hibernate domain classes from tables with annotations at field level? I used Hibernate Tools project and generated domain classes from the tables in the da
I spent a lot of time reading answers from 5+ years ago without understanding how to do it (especially if you work in Intellij and not Eclipse) and how come this is not already solved. So i found it, here it is, and it is simple:
In Intellij:
orm.xml in the same folder as your persistence.xml with this content
FIELD
Your entities will have field annotations!
@Entity
@Table(name = "user", schema = "public", catalog = "my_db")
public class User {
@Id
@Column(name = "id")
private Integer id;
...
}