본문 바로가기 메뉴 바로가기

기억하긴 버거워

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

기억하긴 버거워

검색하기 폼
  • 분류 전체보기 (40)
    • Dev (36)
      • Server (4)
      • Spring (14)
      • Spring Data (10)
      • Java (2)
      • Python (3)
      • Tips (2)
      • TIL (1)
    • Story (1)
  • 방명록

@formula (1)
Spring boot @Formula사용해서 Count Query 하기

@Formula Spring boot Hibernate @Formula 사용하여 Count 하기 프로젝트를 진행할 떄 게시판을 만든다는 가정을 한다. 게시글 댓글이 1:N의 관계이다. 만약 게시글을 불러오면서 댓글의 총 갯수를 알고 싶을때 @Formula 어노테이션을 유용하게 사용 할 수 있을 듯하다. Entity 수정 @Entity public class Board { private Long id; private String title; private String contents; @Formual("(select count(1) from board_comment bc where bc.board_id = id)") private int totalCommentCount; } @Formula 어노테이션을 붙..

Dev/Spring 2020. 7. 12. 15:53
이전 1 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
  • 스프링부트
  • 개발
  • 스프링
  • @formula
  • booleanExpression
  • ResourceHttpReqeustHandler
  • QueryDSL
  • ControllerAdvice
  • Python
  • 자바
  • java11
  • mapstruct
  • ubuntu
  • API
  • Spring
  • 유사결과
  • JPA
  • 웹서비스
  • springboot
  • FastAPI
  • paawordencoder
  • springsecurity
  • 스프링부트 시작하기
  • 스프링시큐리티
  • Security
  • howtoinstallnginx
  • boot
  • like절
  • spring web
  • Java
more
«   2025/05   »
일 월 화 수 목 금 토
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바