title: Sort JPA relational entity lists
body: <p>I'm using PrimeFaces to display information in a DataTable. The data in the datatable is actually a List of entity objects which is generated by OpenJPA. And the entities have relations to other entities. This means that there are Lists inside Lists.</p>
  
  <p>For example, an entity called <strong>Authors</strong>, which has many <strong>Books</strong>. The data <code>List&lt;Authors&gt;</code> is listed in the datatable. And in order to sort the List i use Collections.sort() which of course doesn't work when i try to sort on the Authors book title. Because the title field is an instance of the Book class.</p>
  
  <p>How do i go about to sort the Lists when there are relationships like this?</p>
  
  <p>Thanks in advance.</p>