Boa noite pessoal.
Tenho o seguinte mapeamento:
public class News implements Serializable{
@ManyToOne
@JoinColumn(name = "CATEGORYID", nullable = false)
private Category category;
private String status;
}
public class Category implements Serializable{
@OneToMany(fetch = FetchType.LAZY, mappedBy = "category")
private List<News> news;
public List<News> getNews() {
return news;
}
}
List listaDeNoticias = objetoCategory.getNews();