• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Nested @OrderBy

 
Jay Abrahm
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have three hibernate object A, B and C

A {
@NotNull
@OneToMany
// @OrderBy How to do this based on sortOrder in Class C
private List<B> B = new ArrayList<B>();
}

B {
@NotNull
@ManyToOne
private C C;
}

C {
@Column(name = "SORT_ORDER")
private Integer sortOrder;
}

Is there a way I can get the List B @OrderBy based on the value in sortOrder column in Class C
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic