JPQL Exception: The state field path cannot be resolved

Hello,

I have MANY-TO-MANY relation between two Entities: Transactions and Payments.
In Transaction I have a TokenList from which I have to choose payments.
For a specific transaction I need to chose several payments that should appear read only (per transaction).
In collectionDatasource:paymentDs I have the following querry:

select e from crmrai$Payment e
where e.transaction.id = :ds$transactionDs

Unfortunately I have the following error message:

[37, 53] The state field path ‘e.transaction.id’ cannot be resolved to a valid type.

What is wrong?
see below:

image
image

@neutrino,

I’m trying to understand what you’re trying to accomplish with the query. What exactly do you expect in the results? Care to provide some insight?

Regards,
E’m

Hi,
If you have a many-to-many relationship, the transaction attribute is probably a collection. Then you should join it explicitly in order to filter by its attributes:

select e from crmrai$Payment e left join e.transaction t
where t.id = :ds$transactionDs
1 Like

It works partially.
Unfortunately the chosen payment records are not saved (changes are not propagate to the database - allow commit is checked). It works to select (and view in payment tab and tokenList) certain payments but when I try to edit transaction specific row (just saved) the payments are gone (empty).