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;
}