Bonjour,
Je souhaiterais utiliser JPA pour reprendre la jointures suivante :
Schéma :
Requête équivalente :table1
cle1
champ1a
champ1b
table2
cle2
cle1 (clé étrangère vers TABLE1.cle1)
champ2a
champ2b
L'idée serait donc que ma classe Table1 possède deux listes :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'
Je n'arrive pas à spécifier la seconde condition de la jointure.public class Table1 {
[...]
private List<Table2> table2s_1;
private List<Table2> table2s_2;
[...]
}
Est-ce possible ? Et surtout si oui, comment ?
Partager