Speichern Sie den Einzel -SQL -Abfrageergebnis Boolean Spring Start

@Repository
public interface CompanyRepository extends JpaRepository<Company, Integer> {
    @Query("SELECT CASE WHEN COUNT(c) > 0 THEN true ELSE false END FROM Company c WHERE c.name = :companyName")
    boolean existsByName(@Param("companyName") String companyName);
}
Ill Impala