JPA's Map query by JPQL failed

前端 未结 3 673
没有蜡笔的小新
没有蜡笔的小新 2020-12-10 14:12

I am storing a Map in JPA , which stores a keyword translation in each language . such as one object stores Locale.ENGLISH -> \"Father\" , Locale.CHINESE -> \"Pa

3条回答
  •  不知归路
    2020-12-10 14:43

    I had the same problem. It looks like accessing map by ref (without VALUE()) already gives you a map entry value, i.e. the next JPQL should be transformed to a valid SQL:

    select r from Relation r join r.langMap m where ( KEY(m) = :locale and m = :value )
    

提交回复
热议问题