MysqlDataTruncation Exception with Composite Primary Key in Spring Boot JPA
I'm getting an SQL error when inserting data using Spring JPA and a composite primary key. Here is the relevant code:
@Entity
@IdClass(SeniorityHistoryId::class)
@Table(
indexes = [ Index(columnList = "category", name = "category_index") ],
name = "seniority_history_table"
)
class SeniorityHistory(
@Column(columnDefinition = "date", nullable = false)
@Convert(converter = YearMonthConverter::class)
@Id
val month: YearMonth,
@Column(columnDefinition = "int unsigned",...