I have a little question!
I'am trying to do a query by example on a primary key.
I know that of you put it in a List he is ignoring the primary key.
But i now just want one result.
Artikel result;
Example exampleObject = Example.create(artikel).excludeZeroes(); Criteria criteria = session.createCriteria(Artikel.class);
result = (Artikel) criteria.add(exampleObject).uniqueResult();
return result;
if i search for another variable which is not the primary key it is working fine. Is it possible to do a QBE on a primary key as i am doing above.
for primary key:
13:54:08,031 DEBUG SQL: select this.ArtikelNr as ArtikelNr0_, this.Brutoprijs as Brutoprijs0_, this.Omschrijving as Omschrij3_0_, this.Voorraad as Voorraad0_, this.Kortingsgroep as Kortings5_0_, this.ArtikelNrLev as ArtikelN6_0_, this.LeverancierNr as Leveranc7_0_ from artikel this where (1=1)
for normal variable:
13:46:37,500 DEBUG SQL: select this.ArtikelNr as ArtikelNr0_, this.Brutoprijs as Brutoprijs0_, this.Omschrijving as Omschrij3_0_, this.Voorraad as Voorraad0_, this.Kortingsgroep as Kortings5_0_, this.ArtikelNrLev as ArtikelN6_0_, this.LeverancierNr as Leveranc7_0_ from artikel this where (this.ArtikelNrLev=?)
|