And what should be the return type of something like that? Java has no tuple types so I don't see how this would work out. What you probably want is a constructor expression i.e. a wrapping object. Something like
entityManager.createQuery("SELECT new MyDTO(a, b) FROM FirstClass a "
+ "JOIN SecondClass b "
+ "on a.name = b.name", MyDTO.class);