Dynamic « DAO « JPA Q&A

1. Find concrete class using a dynamic expression (where a Class instance is passed to a DAO)    stackoverflow.com

I have this method signature:

public int nrOfEntities(Class<? extends MailConfirmation> clazz, User user, String email)
I would like nrOfEntities to return the number of entities that:
  • Are of the concrete class clazz
  • Have a matching ...