1
votes

I have a HashMap<String, Float> paramMap

Where the key is the id of entity Invoice and the value is some calculation.

JPA allowes this map to be set as a parameter with name "paramMap".

Is it possible to use the map in the jpql(hql) in the following manner? (the query is simplified for the example but it captures the esence of my inquery)

SELECT Invoice.id as key, :paramMap[Invoice.id] as value from Invoice Invoice

1
No. You cannot. - user8558216
do you want to map the query result to your HashMap? - O.Badr
No. I would like to reference values of the map parameter in the query. - Risto Kavalinovski

1 Answers

0
votes

Is it possible to use a map in JPQL (HQL) in the following manner?

No, it's not possible.