Add this method to the ProductAltId repository (choosing that one because the query returns ProductAltIds):
@Query("select pai from ProductAltId as pai "
+ "where pai.id in (select p.id from Product as p)")
List<ProductAltId> findForAllProducts();
I switched the aliases around, they seem backward in your example.