These two types are not the alternatives of each other, they rather serve the different purposes: CriteriaQuery is used to programmatically define query, instead of writing it manually, and TypedQuery is used to avoid casting which you have to do when using Query .