public interface ReplyRepository extends JpaRepository<Reply, Integer> {
@Modifying // int만 반환 가능함
@Query(value="INSERT INTO reply(userId, boardId, content, createDate) values(?1, ?2, ?3,now())", nativeQuery = true)
int mSave(int userId, int boardId, String content);
}
'유용한 사이트 및 정보' 카테고리의 다른 글
JPA의 양방향 연관관계의 주인 @MappedBy (0) | 2023.02.06 |
---|---|
[Spring] Model(Entity) 유니크 컬럼 만들기 예제 (0) | 2023.02.04 |
<c:choose> , <c:when> EL태그 끼리 비교할 시 예제 (0) | 2023.02.04 |
개발 필수 아이템 포스트맨 사용법 - 로그인 , ajax의 api통신 포함 (0) | 2023.02.04 |
[Spring Security] 스프링 시큐리티 태그 라이브러리 jsp에서 권한 별 처리 + Gradle (0) | 2023.01.21 |
댓글