org.apache.juddi.query
Class FindEntityByIdentifierQuery

java.lang.Object
  extended by org.apache.juddi.query.EntityQuery
      extended by org.apache.juddi.query.FindEntityByIdentifierQuery

public class FindEntityByIdentifierQuery
extends EntityQuery

Returns the list of "entity" keys possessing the keyedReferences in the passed identifier 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) Identifiers are grouped with a logical OR by default. 2) In the case that the "andAllKeys" find qualifier is used the identifiers are AND'd together. The only way this can be done with a single query was to create a self-join for each identifier. If there are a lot of identifiers, the performance could suffer. TODO: Test performance with multiple AND'd identifiers. 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 default behavior of OR'ing all keys.

Author:
Jeff Faath

Field Summary
 
Fields inherited from class org.apache.juddi.query.EntityQuery
DEFAULT_MAXINCLAUSE, DEFAULT_MAXROWS, KEY_NAME
 
Constructor Summary
FindEntityByIdentifierQuery(java.lang.String entityName, java.lang.String entityAlias, java.lang.String keyName, java.lang.String entityField, java.lang.String entityNameChild)
           
 
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 getEntityAlias()
           
 java.lang.String getEntityAliasChild()
           
 java.lang.String getEntityField()
           
 java.lang.String getEntityName()
           
 java.lang.String getEntityNameChild()
           
 java.lang.String getKeyName()
           
 java.lang.String getSelectSQL()
           
 java.util.List<?> select(javax.persistence.EntityManager em, FindQualifiers fq, IdentifierBag identifiers, java.util.List<?> keysIn, DynamicQuery.Parameter... restrictions)
           
 
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
 

Constructor Detail

FindEntityByIdentifierQuery

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

getEntityName

public java.lang.String getEntityName()

getEntityAlias

public java.lang.String getEntityAlias()

getKeyName

public java.lang.String getKeyName()

getEntityField

public java.lang.String getEntityField()

getEntityNameChild

public java.lang.String getEntityNameChild()

getEntityAliasChild

public java.lang.String getEntityAliasChild()

getSelectSQL

public java.lang.String getSelectSQL()

select

public java.util.List<?> select(javax.persistence.EntityManager em,
                                FindQualifiers fq,
                                IdentifierBag identifiers,
                                java.util.List<?> keysIn,
                                DynamicQuery.Parameter... restrictions)

appendConditions

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

appendJoinTables

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


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