BoardRepository ( 내용 추가 )
페이지 정보
본문
package web.repository;
import java.util.List;
import java.util.Optional;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.EntityGraph;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import jakarta.transaction.Transactional;
import web.domain.Board;
public interface BoardRepository extends JpaRepository<Board, Long>, BoardSearch{
@EntityGraph(attributePaths = {"imageSet"})
@Query("select b from Board b where b.bno =:bno")
Optional<Board> findByIdWithImages(@Param("bno") Long bno);
...
}
- 이전글▲ 03. @EntityGraph를 이용한 조회 테스트 24.06.28
- 다음글② BoardRepositoryTest ( read ) 24.06.28
댓글목록
등록된 댓글이 없습니다.