CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
CriteriaQuery<TestTbl> criteriaQuery = criteriaBuilder.createQuery(TestTbl.class);
Root<TestTbl> root = criteriaQuery.from(TestTbl.class);
CriteriaQuery<TestDto> queryMulti = criteriaBuilder.createQuery(TestDto.class);
queryMulti.getRoots().add(root);
CriteriaQuery<?> multiselect = queryMulti.multiselect(root.get(TestTbl_.id));
TypedQuery<TestDto> query = (TypedQuery<TestDto>) entityManager.createQuery(multiselect);
List<TestDto> resultListIds = query.getResultList();