BoardRepository ( 내용 추가 )
페이지 정보
작성자 관리자 작성일 24-06-28 11:07 조회 67 댓글 0본문
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);
...
}
댓글목록 0
등록된 댓글이 없습니다.