public class FindEntityByCombinedCategoryQuery
extends FindEntityByCategoryQuery
Returns the list of "entity" keys possessing the keyedReferences passed in or the level below.
For findBusiness queries, this means keyedReferences on the businessEntity and service levels,
and for findService queries this means keyedReferences on the service and serviceBinding level.
Output is restricted by list of "entity" keys passed in. If null, all entities are searched.
Output is produced by building the appropriate JPA query based on input and find qualifiers.
From the spec :
* From specification:
"combineCategoryBags: this may only be used in the find_business and find_service calls. In the case of
find_business, this qualifier makes the categoryBag entries for the full businessEntity element behave as though all
categoryBag elements found at the businessEntity level and in all contained or referenced businessService elements
and bindingTemplate elements were combined. Searching for a category will yield a positive match on a registered
business if any of the categoryBag elements contained within the full businessEntity element (including the
categoryBag elements within contained or referenced businessService elements or bindingTemplate elements)
contains the filter criteria. In the case of find_service, this qualifier makes the categoryBag entries
for the full businessService element behave as though all categoryBag elements found at the businessService level
and in all contained or referenced elements in the bindingTemplate elements were combined. Searching for a category
will yield a positive match on a registered service if any of the categoryBag elements contained within the
full businessService element (including the categoryBag elements within contained or referenced bindingTemplate
elements) contains the filter criteria. This find qualifier does not cause the keyedReferences in categoryBags
to be combined with the keyedReferences in keyedReferenceGroups in categoryBags when performing the comparison.
The keyedReferences are combined with each other, and the keyedReferenceGroups are combined with each other."
NOTES:
1) Categories are grouped with a logical AND by default.
2) Concerning when the categories are AND'd together - the only way this can be done with a single query was to create a self-join for
each category. If there are a lot of categories, the performance could suffer.
TODO: Test performance with multiple AND'd categories. If too slow, look to process this query in multiple steps.
3) The "orLikeKeys" qualifier complicates matters. The "like" keys are OR'd together and these groups of "like" keys are AND'd together.
As with "andAllKeys", self-joins are created but only one for each group of "like" keys. If none of the keyedReferences passed are alike then this
will reduce to an "andAllKeys" query. If all are alike, then this will query will exhibit the behavior of OR'ing all keys.
- Author:
- Jeff Faath, Tom Cunningham, Kurt Stam