hibernate中注解配置集合排序

hibernate注解配置集合排序,前提是实体实现了Comparable接口。

例子:

@OrderBy("replyTime asc")

@OneToMany(mappedBy = "evalComment", cascade = CascadeType.REMOVE)

private List<EvalCommentReply> evalCommentReplies = new ArrayList<EvalCommentReply>();


你可能感兴趣的:(hibernate集合排序)