I'm trying to create a query so that all items of a given list (parameter) are contained in a a table's column (which is also a list). I also need a query so that at least one item of a given list (parameter) are contained in a table's column. For example:
JDO:
Table: User
| ID | Name | Interests <List of Strings> |
Query:
List <String> gifts; // Item to query with
How can I query for all users whose interests match ALL gifts? i.e. ALL of gifts should be a subset of Interests.
How can I query for all users whose interests match SOME (at least one) gift? i.e. at least one gift is a subset of the interests.
How can I query for all users whose ALL interests match gifts? i.e. ALL of interests should be a subset of gifts.
How can I query for all users whose SOME (at least one) interests match gifts? i.e. at least one interest is a subset of the gifts.
Are these queries possible? If so then how? Can I use the .contains()
keyword to do these queries? If so, then how? Can anyone share some examples? Any help would be highly appreciated.
Thank you.