开发者

Hibernate xml -> annonations described by formula

开发者 https://www.devze.com 2023-03-05 09:09 出处:网络
Is there any possibility to map following xml into annotations? <one-to-one name=\"proper开发者_StackOverflow中文版ty\"

Is there any possibility to map following xml into annotations?

<one-to-one
 name="proper开发者_StackOverflow中文版ty"
 class="org.my.app.TargetObject">
 <formula>APP_ID</formula>
 <formula>'Yes'</formula>
</one-to-one>


Newer versions of Hibernate have @JoinColumnOrFormula. So you could probably map it similar to this:

@OneToOne
@JoinColumnsOrFormulas({
  @JoinFormula("APP_ID"),
  @JoinFormula("YES")
})
0

精彩评论

暂无评论...
验证码 换一张
取 消