I am using Play Framework and Ebean ORM. Say, I have 2 related entity classes (Card.java and FinalMark.java)
Card.java
@Entity
public class Card extends Model {
private static final long serialVersionUID = 1L;
@Id
. . .
@OneToMany(mappedBy = "card")
public List<FinalMark> finalMarks;
. . .
public static Finder<Integer, Card> find =
new Finder<>(Integer.class, Card.class);
}
FinalMark.java
@Entity
public class FinalMark extends Model {
private static final long serialVersionUID = 1L;
@Id
@ManyToOne
public Card card;
. . .
public static Finder<Integer, FinalMark> find = new Finder<>(Integer.class,
FinalMark.class);
}
When I fetching Card
instance (by Card.find.byId() for example), All related FinalMark
instances also will be fetched. But how can I sort them? Is it possible by Ebean or I should sort resulting list?
Thank you for wasting your time.