GithubHelp home page GithubHelp logo

tacademy_jpa's Introduction

JPA 프로그래밍 기본기 다지기

2018. 11. 22. T 아카데미 - 김영한 님

JPA는 특정 DB에 종속적이지 않은 ORM 기술이다.

  • Dialect(방언): SQL 표준을 지키지 않거나 특정 디비만의 고유한 기능. (MySQL, Oracle, H2, ...)
  • 추상화를 통해 디비가 변경되도 충격완화.
  • ORM은 객체와 RDB 두 기둥위에 있는 기술.

JPA의 성능 최적화 기능

  • 1차 캐시와 동일성 보장
  • 트랜잭션을 지원하는 쓰기 지연 - INSERT
  • 지연 로딩과 즉시 로딩

양방향 매핑을 얼마나 잘 이해했는가?

  1. 연관관계의 주인
    • 외래키가 있는 곳을 주인으로 정하라.
  2. MappedBy
    • 주석 참조
  3. 매핑 설계 방법
    • 단방향으로 다 설계하고 양방향이 필요할 때 넣어라.
    • 단방향으로 이미 ORM 이 끝났다.
    • 인지 부조화가 생기지 않도록 해야함.

JPA 내부 구조

  • 영속성 컨텍스트
    • 엔티티를 영구 저장하는 환경. 논리적 개념.
    • EntityManager 와 1:1로 매핑
    • commit 이전의 stage.
    • 1차 캐시
      • 영속 엔티티의 동일성을 보장하게 됨. (==)
      • 변경 감지(Dirty Check)
  • 비영속 상태: 객체를 생성만 한 상태
  • 영속 상태: 생성한 객체를 관리 상태로 변경(JPA)
em.persist(member);

TODO - QueryDSL 사용하기

끝!

tacademy_jpa's People

Contributors

1ilsang avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.