Hmmm. I took a look and I can’t find any errors in the filemaint-addon. As shown before, this is Jobdefs:
@JmixEntity
@Table(name = "JOBDEFS")
@Entity(name = "filemaint_Jobdefs")
public class Jobdefs {
private static final long serialVersionUID = 2913012589319426949L;
@EmbeddedId
protected JobdefsCompKey id;
@MapsId("cus")
@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "CUS_ID", referencedColumnName = "ID")
protected Customers customer;
CUS_ID in Jobdefs is mapped to ID in Customers (not CUS_ID).
JobdefsCompKey is this:
@JmixEntity(name = "filemaint_JobdefsCompKey")
@Embeddable
public class JobdefsCompKey implements Serializable {
private static final long serialVersionUID = -8702137759981849222L;
@Column(name = "CUS_ID")
protected Long cus;
@Column(name = "JOB_ID")
protected Long job;
The column names are CUS_ID and JOB_ID. I do not have them mapped here, so they don’t reference Customers.
In the customer entity, I have this:
@OneToOne(fetch = FetchType.LAZY, mappedBy = "customer", cascade = CascadeType.ALL)
protected Jobdefs jobdefs;
Where is it getting CUSTOMERS.CUS_ID from? I don’t know how to fix it. Any ideas?