하루하나
close
프로필 배경
프로필 로고

하루하나

  • ALL (217)
    • 쿠베플로우 kubeflow (1)
    • React Native (1)
      • Expo (1)
    • Programming (187)
      • spring+jwt+react (4)
      • wordpress (3)
      • Vultr (1)
      • Flutter (3)
      • Vue-project (1)
      • Vue-tip (17)
      • AngularJS (12)
      • Bootstrap (2)
      • Book (1)
      • CentOS (5)
      • Code (0)
      • Css (13)
      • Docker (7)
      • Eclipse (1)
      • Freemarker (1)
      • Git (9)
      • Front-End (6)
      • Error (7)
      • Gulp.js (0)
      • Java (12)
      • Python (5)
      • Javascript (19)
      • JPA (5)
      • jQuery (2)
      • Mac (6)
      • MySql (4)
      • Springboot (21)
      • Springboot-blog (0)
      • Daily (1)
      • Springboot-tip (3)
      • Spring (1)
      • Thymeleaf (1)
      • Tomcat (1)
      • Typescript (3)
      • Tool (5)
      • Sql (1)
      • prisma (1)
      • react (1)
    • Life (14)
      • Review (0)
      • Tip (3)
      • 리뷰 (8)
      • 부동산 (2)
  • 홈
  • 태그
  • 미디어로그
  • 위치로그
  • 방명록

[JPA] 원하는 내용만 가져오기

JPA로 조회를 하다보면 연관관계에 데이터를 모두 가져오다 보니 때때로 노출하고 싶지 않은 데이터도 가져오게 된다. 그럴때 쓰는 방법 소스는 이전글을 참조 2019/03/20 - [JPA] - [JPA] manytoone n+1 문제? 예를 들어 아래와 같은 member entity를 가지고 있다고 할때 @Entity @Getter @Setter public class Member { @Id @GeneratedValue private Long id; private String name; private String phone; private String address; @ManyToOne @JoinColumn(name="team_id") private Team team; } api에는 id와 name만 내..

  • format_list_bulleted Programming/JPA
  • · 2019. 3. 26.
  • textsms

[JPA] manytoone n+1 문제?

JPA에서 @manytoone으로 다른 entity와 join했을 경우 list를 출력하면, 리스트를 한번 조회하고, join column의 id 수만큼 다시 select를 하게된다. Member.java@Entity @Getter @Setter public class Member { @Id @GeneratedValue private Long id; private String name; @ManyToOne @JoinColumn(name="team_id") private Team team; }MemberRepo.javapublic interface MemberRepo extends JpaRepository {}Team.java@Entity @Getter @Setter public class Team { @..

  • format_list_bulleted Programming/JPA
  • · 2019. 3. 20.
  • textsms

[Git] merge 실수로 데이터 날라갔을때.. / git reflog

merge 혹은 rebase 중 실수로 내가 작업한 파일을 덮어썼을때.. (멘붕..) git reflog --date=iso 로 commit log를 확인하고 롤백한 commit log로 체크아웃 해준 후에 다시 돌려 놓는다.

  • format_list_bulleted Programming/Git
  • · 2019. 3. 14.
  • textsms

[springboot] @autowired 안에서 @value로 호출한 값 못 읽을때

Service를 하나 만들었고, Service 생성자 안에서 값을 초기화 해주는 로직을 만들고 있었다. 각각 환경마다 다르게 셋팅해야하는 값이라 application.properties에 값을 넣어주고 불러와서 사용하고 있어다 .예제를 보자면 이런식 @Value("{test.title}") String title; private OtherService otherService; public WebService(OtherService otherService) { this.otherService = otherService; if (title.equals("dev")) { System.out.println("dev setting"); } else { System.out.println("other setting"..

  • format_list_bulleted Programming/Springboot
  • · 2019. 3. 13.
  • textsms

mysql8 계정생성

create user '유저아이디'@'localhost' identified by '비밀번호'; grant all privileges on *.* to '유저아이디'@'localhost' with grant option; - 모든 테이블 권한을 주는 계정 생성 방법 - localhost 접속만 허용 - 외부에서 접근시키고 싶다면 localhost -> %로 변경해주면 된다.

  • format_list_bulleted Programming/MySql
  • · 2019. 3. 12.
  • textsms

[CentOs] nginx 설치하기

- yum을 이용한 초간단 설치 sudo yum install nginx - 설정파일위치 : /etc/nginx/nginx.conf- 실행/정지 : sudo systemctl start nginx / sudo systemctl stop nginx - html파일 위치 : /usr/share/nginx/html/- 로그파일 위치: /var/logs/nginx/ ...

  • format_list_bulleted Programming/CentOS
  • · 2019. 3. 8.
  • textsms
  • navigate_before
  • 1
  • ···
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • ···
  • 37
  • navigate_next
반응형
공지사항
전체 카테고리
  • ALL (217)
    • 쿠베플로우 kubeflow (1)
    • React Native (1)
      • Expo (1)
    • Programming (187)
      • spring+jwt+react (4)
      • wordpress (3)
      • Vultr (1)
      • Flutter (3)
      • Vue-project (1)
      • Vue-tip (17)
      • AngularJS (12)
      • Bootstrap (2)
      • Book (1)
      • CentOS (5)
      • Code (0)
      • Css (13)
      • Docker (7)
      • Eclipse (1)
      • Freemarker (1)
      • Git (9)
      • Front-End (6)
      • Error (7)
      • Gulp.js (0)
      • Java (12)
      • Python (5)
      • Javascript (19)
      • JPA (5)
      • jQuery (2)
      • Mac (6)
      • MySql (4)
      • Springboot (21)
      • Springboot-blog (0)
      • Daily (1)
      • Springboot-tip (3)
      • Spring (1)
      • Thymeleaf (1)
      • Tomcat (1)
      • Typescript (3)
      • Tool (5)
      • Sql (1)
      • prisma (1)
      • react (1)
    • Life (14)
      • Review (0)
      • Tip (3)
      • 리뷰 (8)
      • 부동산 (2)
최근 글
인기 글
최근 댓글
태그
  • #Vue
  • #AngularJS
  • #sts
  • #css
  • #MySQL
  • #JPA
  • #GIT
  • #springboot
  • #javascript
  • #error
전체 방문자
오늘
어제
전체
Copyright © 쭈미로운 생활 All rights reserved.
Designed by JJuum

티스토리툴바