Joined: Thu Feb 08, 2007 5:10 pm Posts: 4
|
Given the following model
public class Service {
private Long id;
private String name;
private List audiences;
....
}
public class Audience {
private Long id;
private String description;
private Provider service;
}
a portion of the service.hbm.xml file:
<bag name="audiences" lazy="false" table="SERVICE_AUDIENCE" >
<key column="serviceId" />
<many-to-many column="audienceId" class="Audience" />
</bag>
it is currently ordered by name, but i actually want to have a secondary odering by audiences which is a collection of some value objects for example:
AUDIENCE table
id description
1 junior
2 senior
SERVICE table
id name
1 service1
2 service2
SERVICE_TABLE
serviceId audienceId
1 1
2 2
how can i configure hibernate so that a collection of services can be first sorted by name and then by audience description?
|
|