本文介绍了当@ManytoOne是拥有方时,有没有一种使用@OrderColumn的方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现 @OrderColumn 仅在以下情况下有效

I found that @OrderColumn works only in the cases of

  • OneToMany是单向关系
  • OneToMany是拥有方(不推荐)

否则,order列将为空.

otherwise the order column just takes nulls.

是真的吗,或者当 @ManytoOne 是拥有方时,有没有办法使用 @OrderColumn ?

Is that true, or there is a way to use @OrderColumn when @ManytoOne is the owning side?

推荐答案

根据休眠文档.但由于 HHH-13287 ,您似乎对双向 @OneToMany @OrderColumn .

According to the hibernate documentation both unidirectional and bidirectional cases should be supported. But it looks like due to the HHH-13287 you have a problem with bidirectional @OneToMany and @OrderColumn.

这篇关于当@ManytoOne是拥有方时,有没有一种使用@OrderColumn的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 08:26