 MappingException: Repeated column in mapping for entity 에러 해결
				
				
					MappingException: Repeated column in mapping for entity 에러 해결
					프로젝트를 진행하다가 Entity를 제대로 설계하지 않아서 MappingException: Repeated column in mapping for entity 에러가 발생했고, 이와 관련해서 간단히 정리해봤습니다.문제 상황 (예시) EntityA @Entity @NoArgsConstructor public class EntityA { @Id @GeneratedValue private Long id; @Column(name = "member_id") private Long memberId; public EntityA(Long memberId) { this.memberId = memberId; } } EntityB EntityB에는 Long 타입의 memberId 필드를 선언했고, OneToOne 관계의 E..
 JdbcTemplate의 Batch Insert 구현시, rewriteBatchedStatements 옵션을 true로 설정하여 성능 문제 해결
				
				
					JdbcTemplate의 Batch Insert 구현시, rewriteBatchedStatements 옵션을 true로 설정하여 성능 문제 해결
					Spring Batch Application과 JPA, JDBC를 함께 사용하여 Batch 작업을 처리해야 하는 상황이 있었습니다. 이때 MySQL Connector/J (JDBC Reference) - Configuration Properties for Connector/J 에서 제공하는 기능들을 몰랐기에, 원하는 대로 동작하지 않았던 문제가 있었습니다. 문제 상황 (예시) 데이터를 가공해서 1,000 ~ 150,000개의 데이터를 Pay 테이블에 넣어야 하는 상황이었습니다. MySQL을 사용하는 상황이었고, JPA의 IDENTITY 방식으로 Batch Insert를 활용하기에는 성능적으로 좋지 않은 부분들이 있었습니다. 이를 해결하기 위해서 JdbcTemplate의 batchUpdate를 활용해서 B..