You can use projections from Spring Data JPA (doc). In your case, create interface:
interface ProjectIdAndName{
String getId();
String getName();
}
and add following method to your repository
List<ProjectIdAndName> findAll();
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…