}
@Override
public long count()
{
CountQueryPostProcessor counter = new CountQueryPostProcessor();
context.addJpaQueryPostProcessor(counter);
try
{
Long result = (Long) ((Query) builder.executeQuery(context)).getSingleResult();
return result.intValue();