tags:

views:

158

answers:

1

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;
}

@Entity
class Detail
{
    @Column(name="altKeyRef")
    @Basic (optional = true)
    Integer altKeyRef;
}

SELECT m, d FROM Master m OUTER JOIN ????? d.altKeyRef = m.altKey
A: 

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).

Pascal Thivent
@Pascal, in other word you talking about impossibility to accomplish this without relation?
Dewfy
@Dewfy yes, that's correct
Pascal Thivent