i use OpenJPA with an Oracle DB. For example, i have a entity that have a Map like this:

@ElementCollection
private Map<Integer, String> mapWithKeys;   

Now, i want load a entity with a subset of the map entries. For example i want load the entity with all map entrys that have the keys "1","3," or "5". Is that possible with JPA Criteria? I didnt find anything about it. I've tried it with a MapJoin, but if one value match the whole map would be load.

Thank you for your time :)

有帮助吗?

解决方案

Just make a little function that fetches the entries one by one.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top