JPA OUTER JOIN no relationship

I need to make OUTER JOINtwo objects in the JPA (speaking master, detail), but the problem is that at the level of essence there is no relationship (and I do not want to add it).

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

@Entity
class Detail
{
    @Column(name="altKeyRef")
    @Basic (optional = true)
    Integer altKeyRef;
}
SELECT m, d FROM Master m OUTER JOIN ????? d.altKeyRef = m.altKey
+3
source share
1 answer

My understanding of the specification (see 4.14 BNF) is that a [ LEFT [OUTER] | INNER ] JOINmush will be executed by a path expression (either an unambiguous association field or an association field with a collection).

+4
source

Source: https://habr.com/ru/post/1745510/


All Articles