# 같은 IDENTITY 매핑을 두 접근 방식으로 선언해 가드에 넘긴다 @Entity static class FieldAccessIdentity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; } @Entity static class PropertyAccessIdentity { private Long id; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) public Long getId() { return id; } public void setId(Long id) { this.id = id; } } 프로파일 batchingRequired : true FieldAccessIdentity IDENTITY 탐지 true 검증 거절 PropertyAccessIdentity IDENTITY 탐지 false 검증 통과 # 하이버네이트는 그 둘을 어떻게 읽는가 — 시퀀스를 대조군으로 둔다 필드 접근 식별자 멤버 Field 삽입 200 프리페어드 스테이트먼트 200 프로퍼티 접근 식별자 멤버 Method 삽입 200 프리페어드 스테이트먼트 200 시퀀스(대조군) 식별자 멤버 Field 삽입 200 프리페어드 스테이트먼트 6 # 가드의 거절이 근거로 삼는 측정과 그것이 도는 레인 22:@Tag("jpa-contract") 25: private static final int BATCH_SIZE = 50; 26: private static final int ROWS = 200; 43: @DisplayName("a sequence entity really produces JDBC batches") 59: .isGreaterThan(1L); 64: @DisplayName("an IDENTITY entity produces no JDBC batch at all") 80: .isZero(); 85: @DisplayName("the sequence assigns identifiers before the flush, so entities are complete") 103: @DisplayName("an IDENTITY key only exists after the insert has been executed") 250:def jpaPlatformContractTest = registerJpaPlatformLane( 251- 'jpaPlatformContractTest', 252- 'jpa-contract', jpa-nightly.yml:49: :adapter:outbound:persistence-jpa:jpaPlatformContractTest jpa-pr.yml:86: :adapter:outbound:persistence-jpa:jpaPlatformContractTest gradlew :adapter:outbound:persistence-jpa:jpaPlatformContractTest --console=plain gradlew :adapter:outbound:persistence-jpa:jpaPlatformContractTest :adapter:outbound:persistence-jpa:jpaPlatformFailureTest --console=plain