Salve io ho il seguente metodo.
public Set listTaglie() throws Exception {
try {
Set<Scheda> ret = new HashSet<Scheda>();
ret.addAll(manager.createQuery("from Scheda").getResultList());
return ret;
} catch (Exception e) {
log.error("listTaglie() - Failed to list Taglie: "+e);
throw e;
}
}
Quando creo la query vorrei che fosse così:
select distinct taglia_scheda from scheda;
Come si fa il distinct?
Grazie
public Set listTaglie() throws Exception {
try {
Set<Scheda> ret = new HashSet<Scheda>();
ret.addAll(manager.createQuery("from Scheda").getResultList());
return ret;
} catch (Exception e) {
log.error("listTaglie() - Failed to list Taglie: "+e);
throw e;
}
}
Quando creo la query vorrei che fosse così:
select distinct taglia_scheda from scheda;
Come si fa il distinct?
Grazie