0

I have classes Category and SubCategory. Now in SubCategoryRepository, I have written a method something like -

@Repository
public interface SubCategoryRepository extends JpaRepository<SubCategory, Long> {

    List<SubCategory> findByCategoryName(String categoryName);
}

How will this implementation work internally? How will it find based on category name. Category class is having field as -

class Category {
    private String categoryName;
}
Nasir
  • 515
  • 5
  • 17
  • 1
    See answer of this question https://stackoverflow.com/questions/61089428/spring-boot-using-jpa-want-to-get-the-unique-value-from-table/61090517#61090517 – Nasir Apr 16 '20 at 21:46
  • 1
    Does this answer your question? [How are Spring Data repositories actually implemented?](https://stackoverflow.com/questions/38509882/how-are-spring-data-repositories-actually-implemented) – Lemmy Apr 16 '20 at 21:47

0 Answers0