Inflearn Community Q&A
Insert 쿼리가 8방 9방 나가길래 확인을 해보았습니다.
Written on
·
2K
0
one to many 관계에서
many관계에 있는 table에, 컬렉션으로 saveAll 쿼리를
날렸는데 8~9방이 나가는겁니다..
헤매고 헤매다가..
generation type이 identity로 해둔게 생각이 나서 설마 했더니 이게 문제가 맞더라구요.
강의에서도 이 말씀을 하더라구요. persist즉시 커밋된다고...
일반적으로 ? 제너레이션 타입을 보통 IDENTITY로 하는게 맞나요 ?
Auto로 하면 성능상 손해가 있나요?
일반적으로 써야 하는 타입이 뭔지 설명 부탁드려도 될까요 ?
Quiz
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
Answer 1
0
안녕하세요. S-J L님
이 부분에 대한 정답은 없습니다.
일반적으로 ID 직접 선택, IDENTITY, SEQUENCE 중에 하나를 선택해서 사용합니다.
감사합니다.





