I trid with:
Code:
Criteria criteria=session.createCriteria(HUtente.class);
HUtente hu=new HUtente();
hu.username="i%";
Example example=Example.create(hu);
example.ignoreCase();
example.enableLike();
example.excludeZeroes();
criteria.add(example);
criteria.createCriteria("gruppi","x0").add(Expression.eq("id",new Long(1)));
criteria.createCriteria("gruppi""x1").add(Expression.eq("id",new Long(3)));
List list=criteria.list();
But i get: java.sql.SQLException: General error, message from server: "Unknown table 'x0' in where clause"
:( :( :(
The sql is:
Code:
select
this.id as id3_,
this.cognome as cognome3_,
this.descrizioneRuolo as descrizi3_3_,
this.grado as grado3_, this.nome as nome3_,
this.password as password3_,
this.username as username3_,
this.livelloPermessi as livelloP8_3_,
this.colonneAnagrafica as colonneA9_3_,
this.enteMilitare as enteMil10_3_,
hentemilit1_.id as id0_,
hentemilit1_.tipoEnte as tipoEnte0_,
hentemilit1_.nome as nome0_,
hentemilit1_.localita as localita0_,
hentemilit1_.email as email0_,
hentemilit1_.fax as fax0_,
hentemilit1_.indirizzo as indirizzo0_,
hentemilit1_.telefono as telefono0_,
hentemilit1_.firma as firma0_,
hentemilit1_.intestazione as intesta10_0_,
hcomune2_.id as id1_,
hcomune2_.nome as nome1_,
hcomune2_.cap as cap1_,
hcomune2_.nazione as nazione1_,
hcomune2_.provincia as provincia1_,
hcomune2_.regione as regione1_,
x1.id as id2_,
x1.nome as nome2_,
x1.descrizione as descrizi3_2_,
x1.permessiFormazione as permessi4_2_,
x1.permessiCooperative as permessi5_2_,
x1.permessiColloqui as permessi6_2_,
x1.permessiCollocamento as permessi7_2_,
x1.permessiBandi as permessi8_2_,
x1.permessiAnagrafica as permessi9_2_,
x1.permessiOfferte as permess10_2_,
x1.permessiOrientamento as permess11_2_,
x1.permessiSistema as permess12_2_,
x1.permessiStati as permess13_2_,
x1.tipologiaReportistica as tipolog14_2_
from ut_utente this
left outer join su_entemilitare hentemilit1_ on this.enteMilitare=hentemilit1_.id
left outer join su_comune hcomune2_ on hentemilit1_.localita=hcomune2_.id
inner join ut_utente_gruppo gruppi3_ on this.id=gruppi3_.idUtente
inner join ut_gruppo x1 on gruppi3_.idGruppo=x1.id where (1=1) and x0.id=? and x1.id=?