开发者

JPA 2.0 / Hibernate custom join clause on association

开发者 https://www.devze.com 2023-03-01 01:16 出处:网络
I would like开发者_运维知识库 to associate 2 entities using hibernate or JPA 2.0 annotations with a custom join clause. The clause is not the usual FK/PK equality. In SQL this would be something like

I would like开发者_运维知识库 to associate 2 entities using hibernate or JPA 2.0 annotations with a custom join clause. The clause is not the usual FK/PK equality. In SQL this would be something like this:

join b on a.id = 1000 * b.a_id

is it possible to annotate such a custom join where clause and to ignore the default one

join b on a.id = b.a_id


Hibernate's @JoinFormula allows this. Look at this RFE for an example: https://hibernate.onjira.com/browse/HHH-5171?page=com.atlassian.jira.plugin.system.issuetabpanels%253Achangehistory-tabpanel

0

精彩评论

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