I see you are using @Inheritance(JOINED) annotation so the subclasses got foreign key column(s) which primary key of superclass.
I am going to recommend you solution on Spring Data JPA. On implementation, I didn't see any problem so I can help you for implement @Repository interface.
@Repository
public interface AbstractCompanyRepository extends JpaRepository<AbstractCompany, Long> {
@Query("SELECT DISTINCT a FROM AbstractCompany a " +
"JOIN Company c ON c.id = a.id " +
"JOIN Invitation i ON i.id = a.id " +
"WHERE c.city = 'London' " +
"AND NOT i.expired")
List<AbstractCompany> getLondonAndNotExpired();
}