Query sys$FileDescriptor

How can I Query

select e from sys$FileDescriptor e WHERE e.id = :ds$ordreDs

With this I mean that i want to select only the attachments (Files) for the spesific Order.
I misses documenttation on how to use query against sys$FileDescriptor.

1 Like

It depends on how you linked the FileDescriptor with Order.
Could you provide a small project illustrating the problem?

I discovered that the relationship between FileDescriptor and order was Many to One and Many to Many.
What I need is One Order has Many Attachments (Files).
The opposite way.
How can I archive this.

I discovered that the relationship between FileDescriptor and order was Many to One and Many to Many.
What I need is One Order has Many Attachments (Files).
The opposite way.
How can I archive this.

Introduce an intermediate entity - Attachment, which has ManyToOne reference to Order and ManyToOne reference to FileDescriptor.
Then in Order you can create a OneToMany collection of Attchments and use either a nested datasource for it, or a dependent datasource with a query like

select a from sample$Attachment a where a.order.id = :ds$orderDs

The view for attachments should include the linked FileDescriptor.

That was what I though.
And I can put it into the same screen as Order.