Illegal Argument when selecting association attribute

I am selecting an entity and passing it as a parameter to the next screen like this


openWindow("debtc$Debtor.browse",WindowManager.OpenType.THIS_TAB,ParamsMap.of("creditor",c));

On the next screen, I want to use the entity like this:


debtorsDs.setQuery("select e from debtc$Debtor e where e.creditor = :param$creditor");	

The entity Debtor has an association attribute, creditor. (For this exercise each Debtor has only one Creditor M:1)

For the above code, I get an error: IllegalArgumentException: You have attempted to set a value of type class java.util.UUID for parameter param_creditor

How do I set my DebtorsDs query to retrieve only Debtors associated with the selected creditor?

You do everything right except one thing: you should use “id” attribute for testing equality in the condition:


select e from debtc$Debtor e where e.creditor.id = :param$creditor

You can still pass an entity instance instead of its id as a parameter value - the platform will extract id automatically.

Thanks…that works,