开发者

JPA OUTER JOIN without relation

开发者 https://www.devze.com 2022-12-30 13:42 出处:网络
I need make OUTER JOIN of two entities in JPA (saying master, detail), but the problem that at the entity level there are no relations (and I don\'t want add it).

I need make OUTER JOIN of two entities in JPA (saying master, detail), but the problem that at the entity level there are no relations (and I don't want add it).

@Entity
class Master
{
    @Column(name="altKey")
    Integer altKey;
}

@Ent开发者_JAVA百科ity
class Detail
{
    @Column(name="altKeyRef")
    @Basic (optional = true)
    Integer altKeyRef;
}
SELECT m, d FROM Master m OUTER JOIN ????? d.altKeyRef = m.altKey


My understanding of the spec (see 4.14 BNF) is that a [ LEFT [OUTER] | INNER ] JOIN mush be done along a path expression (either a single valued association field or a collection valued association field).

0

精彩评论

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