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")
})
精彩评论