这是我的简单情况:
@Entity
@Table(name = "project")
public class Project implements Serializable {
@Id
private Long id;
@OneToMany(mappedBy = "project")
private List<Author> authors;
public List<Author> getAuthors() {
return authors;
}
}
public class DAO {
public void getOrderedAuthorsByProject(Project project) {
return project.getAuthors(); // Line 1
}
}
在第1行中,如何返回作者列表,按作者实体的特定列排序,简单地做一个get?
谢谢。