강의

멘토링

로드맵

인프런 커뮤니티 질문&답변

김민지님의 프로필 이미지
김민지

작성한 질문수

자바 ORM 표준 JPA 프로그래밍 - 기본편

실전 예제 1 - 요구사항 분석과 기본 매핑

id를 id라고 안하고 ITEM_ID로 해주는 이유가 뭔가요?

작성

·

284

0

왜그런거죠?

퀴즈

A class using the `@Entity` annotation for JPA mapping must basically meet these important conditions: 1. It must have a no-argument constructor (default constructor). 2. It must have a field representing the primary key, usually marked with the `@Id` annotation. 3. The class itself cannot be `final`. 4. It cannot be an `enum` or an `interface`.

All fields must be public

must be a final class

Must have a public or protected default constructor

must include at least one static method

답변 1

0

안녕하세요. 김민지님, 공식 서포터즈 OMG입니다.

어떤 엔티티의 id인지 구체적인 명시로 얻는 장점이 있으며 추가적인 이유는

아래 영한님의 설명을 참고해주세요(17분~)

https://www.inflearn.com/course/ORM-JPA-Basic/lecture/21695?tab=curriculum&volume=1.00

중요한 것은 한 프로젝트 내에서 네이밍 규칙은 일관되게 가져가는 것이라 생각합니다 :) 


감사합니다.

김민지님의 프로필 이미지
김민지

작성한 질문수

질문하기