Hibernate version: 3.2.5.ga
I've seen a bunch of posts on this subject. Most have no responses. Some have responses like 'This is not supported' but they are from 3 years ago.
Is the following possible? (OrderBy on field of sub-collection, in this case EstablishmentResidueType.ResidueType.description, using dotted notation or something else?
Code:
@Entity
@Table(name = "establishment")
public class Establishment
{
private Set<EstablishmentResidueType> establishmentResidueTypes;
...
@OneToMany(cascade = { CascadeType.ALL })
@JoinColumn(name="idEstablishment")
@OrderBy("residueType.description ASC")
getEstablishmentResidueTypes ()
{
...
}
...
}
public class EstablishmentResidueType
{
private Establishment establishment;
private ResidueType residueType;
...
}
public class ResidueType
{
private String description;
...
}
Many thanks!
Bob