[EDIT] 名前で検索できる機能を追加しました。
This commit is contained in:
@@ -1,9 +1,15 @@
|
||||
package com.example.demo.app.infra.repository;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
|
||||
import com.example.demo.app.infra.entity.CategoryEntity;
|
||||
|
||||
public interface CategoryRepository extends JpaRepository<CategoryEntity, Long> {
|
||||
|
||||
|
||||
@Query("select c from CategoryEntity c where c.categoryName = :categoryName")
|
||||
public CategoryEntity findByCategoryName(@Param("categoryName") String categoryName);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user