Entity Designer Cross Data Store Association failure to instantiate joined objects

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 ;

@Column(name = "DOCUMENT_ID", nullable = false)
private Integer documentId;

@JmixProperty(mandatory = true)
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?

JPQL queries work only within a single data store.
So you cannot write a query like select e from Foo e where e.document.name = ?.
But when you load Foo, you can specify a fetch plan containing document attribute, so you’ll get the Foo instances with associated documents.

See Cross-Datastore References.

I saw that in the docs but excuse my ignorance, can you give an example of the fetch plan you speak of?

Have you seen this example in the docs?
Also, the screen creation wizard generates fetch plans like this: