File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Spring_part_15/src/main/java/spring/oldboy/database/repository/company_repository Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 1+ package spring .oldboy .database .repository .company_repository ;
2+
3+ import org .springframework .data .jpa .repository .JpaRepository ;
4+ import org .springframework .data .jpa .repository .Query ;
5+ import org .springframework .data .repository .query .Param ;
6+ import spring .oldboy .database .entity .Company ;
7+
8+ import java .util .List ;
9+ import java .util .Optional ;
10+
11+ public interface CompanyRepository extends JpaRepository <Company , Integer > {
12+
13+ @ Query ("select c from Company c " +
14+ "join fetch c.locales cl " +
15+ "where c.name = :name2" )
16+ Optional <Company > findByName (@ Param ("name2" ) String name );
17+
18+ List <Company > findAllByNameContainingIgnoreCase (String fragment );
19+ }
You can’t perform that action at this time.
0 commit comments