Hi,
I'm trying to achive a "group by xxx having count(*) > 1"-select using criteria.
So far I achieved the "group by"-part (see below).
Code:
Criteria symbolCriteria = getSession().createCriteria(Symbol.class, "sym");
Criteria symbolVarianteCriteria = symbolCriteria .createCriteria(Symbol.REF_VARIANTEN, "sym_va");
Criteria imageDataCriteria = symbolVarianteCriteria.createCriteria(SymbolVariante.PROPERTY_IMAGEDATA, "imgd");
ProjectionList projections = Projections.projectionList();
projections.add(Projections.groupProperty("sym_va." + SymbolVariante.PROPERTY_COLOR));
projections.add(Projections.groupProperty("imgd." + ImageData.PROPERTY_FILENAME));
symbolCriteria .setProjection(projections);
final List symbols = symbolCrit.list();
But I still haven't found the solution for the "having count(*) > 1"-part.
Is this possible?
Thanks
Jonny