I have a little question about sorting on OneToMany relationship. Here is the sample code. I would like to have all of the results of class A sorted according to C.title. What is the correct syntax?
Example:
=========
@Entity
@Table (name = "A")
public class A extends Domain {
...
@OneToMany (mappedBy = "B")
@OrderBy ("C.title")
public ArrayList<B> results = new ArrayList <> ();
..
}
=========
@Entity
@Table (name = "B")
public class B extends Domain {
...
@ManyToOne (mappedBy = "C")
public C results;
..
}
=========
@Entity
@Table (name = "C")
public class C extends Domain {
...
private string title;
..
}