> For the complete documentation index, see [llms.txt](https://dodeon.gitbook.io/study/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dodeon.gitbook.io/study/kimyounghan-orm-jpa/09-value-type.md).

# 값 타입

## Entity 타입

* `@Entity`로 정의하는 객체
* 데이터가 변해도 식별자로 지속해서 추적 가능하다.
  * 회원 Entity의 키나 나이를 변경해도 id로 찾을 수 있다.

## 값 타입

* int, Integer, String처럼 단순히 값으로 사용하는 자바 기본 타입 혹은 객체
* 식별자가 없고 값만 있으므로 변경되면 추적이 불가능하다.
  * 숫자 100을 200으로 변경하면 완전히 다른 값으로 대체된다.

### 값 타입의 분류

* 기본값 타입
  * 자바 기본 타입(int, double)
  * 래퍼 클래스(Integer, Long)
  * String
* 임베디드 타입(embedded type, 복합값 타입)
  * 객체처럼 묶어 커스텀 해서 쓰고 싶을 때 사용한다.
* 컬렉션 값 타입(collection value type)
  * 자바 컬렉션에 기본값 타입이나 임베디드 타입을 넣을 수 있는 타입이다.
