Post

2022-03-12-TIL

2022-03-12-TIL

Today I Learned

Microservice

  • https://blog.lgcns.com/1278

Stream

  • https://tecoble.techcourse.co.kr/post/2021-05-23-stream-api-basic/

Count 쿼리 성능

  • https://yjh5369.tistory.com/206
  • https://okky.kr/article/295940
  • https://www.phpschool.com/gnuboard4/bbs/board.php?bo_table=tipntech&wr_id=77484

Using Serializable Entities

  • https://jongminlee0.github.io/2020/03/15/serializable/
  • https://derekpark.tistory.com/113
  • https://docs.oracle.com/cd/E17277_02/html/collections/tutorial/SerializableEntity.html
  • https://jihogrammer.tistory.com/76?category=958760
  • https://www.inflearn.com/questions/17117
  • https://www.inflearn.com/questions/16570
  • https://www.baeldung.com/jpa-entities-serializable
  • https://developmentnotepad.tistory.com/entry/Spring-%EC%9E%90%EB%B0%94-%EC%A7%81%EB%A0%AC%ED%99%94-Serializable?category=805012

웹 사이트에서 업로드할 파일 사이즈를 제한한다면 얼마가 좋을까?

  • https://help.pro.photo/troubleshooting/servers/upload-file-size/
  • https://ux.stackexchange.com/questions/95196/how-can-we-go-about-deciding-an-appropriate-filesize-upload-limit
  • https://flothemes.com/flothemes-image-sizes/
  • https://www.foregroundweb.com/image-size/

@DynamicUpdate와 부분 업데이트

  • https://velog.io/@freddiey/JPA%EC%9D%98-DynamicUpdate
  • https://www.baeldung.com/spring-data-partial-update
  • https://www.baeldung.com/spring-data-jpa-dynamicupdate
  • https://thorben-janssen.com/dynamic-inserts-and-updates-with-spring-data-jpa/
  • https://stackoverflow.com/questions/64500153/jpa-only-update-in-table-and-not-insert

JPA에서 Entity에 반드시 테이블의 모든 컬럼을 매팽해야하는가?

반드시 모두 매핑할 필요는 없다. JPA로 관리할 엔티티에 필요한 필드만 추가하면 된다. 단, 데이터베이스 내에서 필수값으로 설정되어있는 경우, 해당 값이 없이 save()같은 메서드를 호출하면 제약조건 위반 에러가 날 수 있다. 변경하고자 하는 필드만 가진 엔티티를 만들면 save() 호출 시 해당 필드에 대해서만 변경되니까 @DynamicUpdate를 사용할 필요도 없어진다.

  • https://stackoverflow.com/questions/19713594/can-an-entity-class-work-without-having-a-definition-for-all-columns-of-the-tabl

JPA update and insert (upsert)

  • https://jessyt.tistory.com/42
  • https://velog.io/@roro/JPA-JPQL-update-%EC%BF%BC%EB%A6%AC%EB%B2%8C%ED%81%AC%EC%99%80-%EC%98%81%EC%86%8D%EC%84%B1-%EC%BB%A8%ED%85%8D%EC%8A%A4%ED%8A%B8

@Data 애너테이션을 지양하자

  • https://velog.io/@rosa/Lombok-%EC%A7%80%EC%96%91%ED%95%B4%EC%95%BC-%ED%95%A0-annotation
  • https://www.daleseo.com/lombok-popular-annotations/

@Query in JPA

  • https://www.baeldung.com/spring-data-jpa-query

정적 팩토리 메서드

  • https://tecoble.techcourse.co.kr/post/2020-05-26-static-factory-method/

DTO 깔끔하게 관리하기

  • https://velog.io/@p4rksh/Spring-Boot%EC%97%90%EC%84%9C-%EA%B9%94%EB%81%94%ED%95%98%EA%B2%8C-DTO-%EA%B4%80%EB%A6%AC%ED%95%98%EA%B8%B0

DTO to Entity 변환

기본적으로 직접 정적 팩토리 메서드를 만들어서 변환하는 방법이 있다. 그외에 라이브러리를 사용하는 방법으로는 두 가지가 있다. ModelMapper를 사용하는 방법, MapStruct를 사용하는 방법이다.

  • https://jforj.tistory.com/93
  • https://donghyeon.dev/jpa/2020/07/12/JPA%EC%9D%98-DTO%EC%99%80-Entity/
  • https://www.baeldung.com/entity-to-and-from-dto-for-a-java-spring-application
  • https://lob-dev.tistory.com/entry/%EA%B0%9D%EC%B2%B4-%EB%B3%80%ED%99%98%ED%95%98%EA%B8%B0-%EC%9E%90%EB%B0%94-%EC%BD%94%EB%93%9C-%EB%A7%A4%ED%95%91-vs-MapStruct-vs-ModelMapper

DTO, VO, Entity

  • https://parkadd.tistory.com/53
  • https://velog.io/@gillog/Entity-DTO-VO-%EB%B0%94%EB%A1%9C-%EC%95%8C%EA%B8%B0
  • https://tecoble.techcourse.co.kr/post/2020-06-11-value-object/

DTO를 사용하지 않고 Map을 사용하는 경우

  • https://okky.kr/article/370609
  • https://kin.naver.com/qna/detail.nhn?d1id=1&dirId=1040201&docId=71573791&qb=Vk8g7YG0656Y7Iqk&enc=utf8&section=kin&rank=1&search_sort=0&spq=0&pid=gpRtcF5Y7uCsstDvUh0ssc–514595&sid=TpTa0DjMlE4AADv9GoY

개발자 커뮤니티

  • https://www.freecodecamp.org/news/best-developer-communities-to-be-part-of-in-2020/
  • https://freemoa-blog.com/438
  • https://blog.naver.com/freemoa1/221610785501
This post is licensed under CC BY 4.0 by the author.