JPA and many-to-many relations in google app engine

*爱你&永不变心* 提交于 2019-12-02 02:42:34

If you refactor your relationship mapping you can get a better query. Instead of storing a set of keys in A, store a set of keys in B. Then you can query with

select * from B where a_id = {idOfRelevantA} and property0 = {criterion0} and property1 = {criterion1}...

This way you avoid the multiple queries that the in operator creates.

Also, beware: in will only work for a list of 30 elements or fewer.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!