Pessoal peguei um material de JPA para estudar porém não tenho a video aula. Seguindo estudando o código fiquei com a seguinte duvida:
package bar.model;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
@Entity
public class Sushi {
@Id
private int id;
private String name;
@ManyToOne (cascade=CascadeType.PERSIST)
@JoinColumn(name="idtype")
private Type type;
public Type getType() {
return type;
}
public void setType(Type type) {
this.type = type;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
Para que serve a coluna Com as seguintes anotações:
@ManyToOne (cascade=CascadeType.PERSIST)
@JoinColumn(name="idtype")
