org.apache.juddi.query
Class FindEntityByCategoryQuery

java.lang.Object
  extended by org.apache.juddi.query.EntityQuery
      extended by org.apache.juddi.query.FindEntityByCategoryQuery
Direct Known Subclasses:
FindEntityByCombinedCategoryQuery

public class FindEntityByCategoryQuery
extends EntityQuery

Returns the list of "entity" keys possessing the keyedReferences in the passed category bag. 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. 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

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

Field Detail

entityName

protected String entityName

entityAlias

protected String entityAlias

keyName

protected String keyName

entityField

protected String entityField

entityNameChild

protected String entityNameChild

entityAliasChild

protected String entityAliasChild

selectSQL

protected String selectSQL

signaturePresent

protected String signaturePresent
Constructor Detail

FindEntityByCategoryQuery

public FindEntityByCategoryQuery(String entityName,
                                 String entityAlias,
                                 String keyName,
                                 String entityField,
                                 String entityNameChild,
                                 String signaturePresent)
Method Detail

getEntityName

public String getEntityName()

getEntityAlias

public String getEntityAlias()

getKeyName

public String getKeyName()

getEntityField

public String getEntityField()

getEntityNameChild

public String getEntityNameChild()

getEntityAliasChild

public String getEntityAliasChild()

getSelectSQL

public String getSelectSQL()

getSignaturePresent

public String getSignaturePresent()

setSignaturePresent

public void setSignaturePresent(String signaturePresent)

select

public List<?> select(javax.persistence.EntityManager em,
                      FindQualifiers fq,
                      CategoryBag categoryBag,
                      List<?> keysIn,
                      DynamicQuery.Parameter... restrictions)

appendConditions

public void appendConditions(DynamicQuery qry,
                             FindQualifiers fq,
                             List<KeyedReference> keyedRefs)

appendJoinTables

public void appendJoinTables(DynamicQuery qry,
                             FindQualifiers fq,
                             List<KeyedReference> keyedRefs)


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