Bonjour,

Je souhaiterais utiliser JPA pour reprendre la jointures suivante :

Schéma :
table1
cle1
champ1a
champ1b

table2
cle2
cle1 (clé étrangère vers TABLE1.cle1)
champ2a
champ2b
Requête équivalente :
select *
from table1
left join table2 on table1.cle1=table2.cle1 and table2.champ2a='0'
left join table2 on table1.cle1=table2.cle1 and table2.champ2a='1'
L'idée serait donc que ma classe Table1 possède deux listes :
public class Table1 {
[...]
private List<Table2> table2s_1;
private List<Table2> table2s_2;
[...]
}
Je n'arrive pas à spécifier la seconde condition de la jointure.
Est-ce possible ? Et surtout si oui, comment ?