This content has been marked as final.
Show 2 replies
-
1. Re: Sorting Detail data in Master/Detail
griffitm Oct 26, 2007 11:56 AM (in response to griffitm)Ok, I found that I can at least control the detail records by using the JPA annotation @OrderBy on the many to one relationship as such:
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="section") @OrderBy("dueDate") public Set<Deliverable> getDeliverables(){ return this.deliverables; }
Does anyone have any idea how to sort the list dynamically from that point forward?
MG -
2. Re: Sorting Detail data in Master/Detail
pmuir Oct 27, 2007 6:12 AM (in response to griffitm)1) A separate entity query for that (not neat at the domain model level)
2) Do it through Comparable and List sorts (potentially much slower than using SQL to sort