Программирование
- 3 ответа
- 0 вопросов
2
Вклад в тег
@Entity
@Table (name = "todo")
public class Task {
.....
@ManyToOne
@JoinColumn(name = "userId")
private User responsibleUser;
.....
}
@Entity
@Table (name = "users")
public class User {
.....
@Id
@Column (name = "userId")
private Integer userId;
@OneToMany (mappedBy = "responsibleUser")
private Set<Task> tasks = new HashMap<Task>();
.....
}