Caused by: org.hibernate.MappingException: Repeated column in mapping for entity: jp.co.XXX.entity.Case column: contact__herokurecordid__c (should be mapped with insert="false" update="false")
とのエラーになったら以下のように@JoinColumn
にinsertable = false, updatable = false
を書く
@Column(name = "contact__herokurecordid__c", length = 255)
private String contactHerokuRecordId;
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "contact__herokurecordid__c", referencedColumnName = "herokurecordid__c", insertable = false, updatable = false)
@Setter(AccessLevel.NONE)
private Contact contact;
public String getContactLastName() {
if (contact != null) {
return contact.getLastName();
}
return null;
}