org.apache.juddi.query
Class FindEntityByCombinedCategoryQuery

java.lang.Object
  extended by org.apache.juddi.query.EntityQuery
      extended by org.apache.juddi.query.FindEntityByCategoryQuery
          extended by org.apache.juddi.query.FindEntityByCombinedCategoryQuery

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

Field Summary
protected  java.lang.String entityAliasChild2
           
protected  java.lang.String entityNameChild2
           
 
Fields inherited from class org.apache.juddi.query.FindEntityByCategoryQuery
entityAlias, entityAliasChild, entityField, entityName, entityNameChild, keyName, selectSQL
 
Fields inherited from class org.apache.juddi.query.EntityQuery
DEFAULT_MAXINCLAUSE, DEFAULT_MAXROWS, KEY_NAME
 
Constructor Summary
FindEntityByCombinedCategoryQuery(java.lang.String entityName, java.lang.String entityAlias, java.lang.String keyName, java.lang.String entityField, java.lang.String entityNameChild)
           
FindEntityByCombinedCategoryQuery(java.lang.String entityName, java.lang.String entityAlias, java.lang.String keyName, java.lang.String entityField, java.lang.String entityNameChild, java.lang.String entityNameChild2)
           
 
Method Summary
 void appendConditions(DynamicQuery qry, FindQualifiers fq, java.util.List<KeyedReference> keyedRefs)
           
 void appendJoinTables(DynamicQuery qry, FindQualifiers fq, java.util.List<KeyedReference> keyedRefs)
           
 java.lang.String getEntityAliasChild2()
           
 java.lang.String getEntityNameChild2()
           
 java.util.List<?> select(javax.persistence.EntityManager em, FindQualifiers fq, CategoryBag categoryBag, java.util.List<?> keysIn, DynamicQuery.Parameter... restrictions)
           
 
Methods inherited from class org.apache.juddi.query.FindEntityByCategoryQuery
getEntityAlias, getEntityAliasChild, getEntityField, getEntityName, getEntityNameChild, getKeyName, getSelectSQL
 
Methods inherited from class org.apache.juddi.query.EntityQuery
buildAlias, getPagedResult, getQueryResult
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

entityNameChild2

protected java.lang.String entityNameChild2

entityAliasChild2

protected java.lang.String entityAliasChild2
Constructor Detail

FindEntityByCombinedCategoryQuery

public FindEntityByCombinedCategoryQuery(java.lang.String entityName,
                                         java.lang.String entityAlias,
                                         java.lang.String keyName,
                                         java.lang.String entityField,
                                         java.lang.String entityNameChild)

FindEntityByCombinedCategoryQuery

public FindEntityByCombinedCategoryQuery(java.lang.String entityName,
                                         java.lang.String entityAlias,
                                         java.lang.String keyName,
                                         java.lang.String entityField,
                                         java.lang.String entityNameChild,
                                         java.lang.String entityNameChild2)
Method Detail

getEntityNameChild2

public java.lang.String getEntityNameChild2()

getEntityAliasChild2

public java.lang.String getEntityAliasChild2()

select

public java.util.List<?> select(javax.persistence.EntityManager em,
                                FindQualifiers fq,
                                CategoryBag categoryBag,
                                java.util.List<?> keysIn,
                                DynamicQuery.Parameter... restrictions)
Overrides:
select in class FindEntityByCategoryQuery

appendConditions

public void appendConditions(DynamicQuery qry,
                             FindQualifiers fq,
                             java.util.List<KeyedReference> keyedRefs)
Overrides:
appendConditions in class FindEntityByCategoryQuery

appendJoinTables

public void appendJoinTables(DynamicQuery qry,
                             FindQualifiers fq,
                             java.util.List<KeyedReference> keyedRefs)
Overrides:
appendJoinTables in class FindEntityByCategoryQuery


Copyright © 2004-2011 The Apache Software Foundation. All Rights Reserved.