Zdravim vsechny. Mam nasledujici entity kde Entita2 obsahuje dve reference na Entitu1 spojenou pres id.

Entita1 {
   Long id;
   String text;
}

Entita2 {
   Long id;
   String text;
   Entita1 entA;
   Entita1 entB;
}


Chtel bych vytvorit dotaz pomoci kriterii, ktery by mel za cil nacist Entity2 podle podminky napr:

text = '?' and (entA.text = ? or entB.text = ?)

Jde mi o to, ze se mi nedari prijit na to jak pomoci kriterii vytvorit ten OR mezi hodnotou textu entA a hodnotou textu entB.

Dekuji Jaroslav Hurdes

Odpovedet emailem