Using the Entity Designer to create associations between entities acts differently between inter-datastore vs cross datastore entities. The problem with the cross datastore association is the joined objects do not get instantiated automatically. I.e. JPQL queries return null values when referencing the cross datastore joined value.
Intra-Datastore join may look like this;
@JoinColumn(name = “RECORD_COUNT_TASK_ID”, nullable = false)
@ManyToOne(optional = false)
private RecordCountTask recordCountTask;
But a Cross-Datastore looks like this with adding a persisted key ;
@SystemLevel
@Column(name = "DOCUMENT_ID", nullable = false)
private Integer documentId;
@DependsOnProperties({"documentId"})
@JmixProperty(mandatory = true)
@Transient
private Document document;
public Document getDocument() {
return document;
}
public void setDocument(Document document) {
this.document = document;
}
public Integer getDocumentId() {
return documentId;
}
public void setDocumentId(Integer documentId) {
this.documentId = documentId;
}
What do I need to do get JPQL to instantiate the join object?