Is in hibernate something like code first approach from Entity Framework? I am trying to prepare database tables from java classes (MySQL). I have already prepared java classes with JPA annotations, but I am not sure what to do now (I am using IntelliJ). What should I have in my main to create thoose tables? Or should I use some tools?
One of my classes looks like this:
@Entity
public class Item {
@Id
@GeneratedValue
private long id;
@Column
private String text;
@ManyToMany(mappedBy = "items")
private Set<Container> containers = new HashSet<Container>();
public long getId() {
return id;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public Set<Container> getContainers() { return containers; }
}