Package org.apache.juddi.query.util

Examples of org.apache.juddi.query.util.DynamicQuery$Parameter


            DynamicQuery.PREDICATE_EQUALS);
        params.add(param);
        requiredCount++;
      }
     
      DynamicQuery checkParentKeyQry = new DynamicQuery();
      checkParentKeyQry.append("select COUNT(t.entityKey) from Tmodel t").pad();

      checkParentKeyQry.WHERE().pad().appendGroupedAnd(pubParam);
      checkParentKeyQry.AND().pad().appendGroupedOr(params.toArray(new DynamicQuery.Parameter[0]));
     
      Query qry = checkParentKeyQry.buildJPAQuery(em);     
      Number resultCount = (Number)qry.getSingleResult();
      if (resultCount.longValue() != requiredCount)
        return false;
    }
    else {
      // If only two tokens, then a domain key generator is being checked.  A domain key generator can only be registered if no other publishers
      // own it.  For example, if trying to register the uddi:domain:abc:123 key then uddi:domain cannot be owned by another publisher.
      DynamicQuery.Parameter notPubParam = new DynamicQuery.Parameter("t.authorizedName",
           getAuthorizedName(),
           DynamicQuery.PREDICATE_NOTEQUALS);

      DynamicQuery.Parameter keyParam = new DynamicQuery.Parameter("UPPER(t.entityKey)",
          (domainPartition + KeyGenerator.PARTITION_SEPARATOR + KeyGenerator.KEYGENERATOR_SUFFIX).toUpperCase(),
          DynamicQuery.PREDICATE_EQUALS);
     
      DynamicQuery checkDomainKeyQry = new DynamicQuery();
      checkDomainKeyQry.append("select t.entityKey from Tmodel t").pad();
     
      checkDomainKeyQry.WHERE().pad().appendGroupedAnd(notPubParam, keyParam);

      Query qry = checkDomainKeyQry.buildJPAQuery(em);
      List<?> obj = qry.getResultList();
      // If there are results then another publisher has the domain key and therefore the key generator is unavailable
      if (obj != null && obj.size() > 0)
        return false;
    }
View Full Code Here


   
    List<String> tmodelKeys = tModels.getTModelKey();
    if (tmodelKeys == null || tmodelKeys.size() == 0)
      return keysIn;
   
    DynamicQuery dynamicQry = new DynamicQuery(selectSQL);
    appendConditions(dynamicQry, fq, tmodelKeys);
   
    if (restrictions != null && restrictions.length > 0)
      dynamicQry.AND().pad().appendGroupedAnd(restrictions);
   
    return getQueryResult(em, dynamicQry, keysIn, ENTITY_ALIAS + "." + KEY_NAME);
  }
View Full Code Here

   
    // If keysIn is null or empty, then nothing to fetch.
    if ((keysIn == null) || (keysIn.size() == 0))
      return Collections.emptyList();

    DynamicQuery dynamicQry = new DynamicQuery(selectSQL);
    appendSortTables(dynamicQry);
    dynamicQry.appendInListWithAnd(ENTITY_ALIAS + "." + KEY_NAME, keysIn);
    if (restrictions != null && restrictions.length > 0)
      dynamicQry.AND().pad().appendGroupedAnd(restrictions);
   
    appendSortCriteria(dynamicQry, fq);

    log.debug(dynamicQry);
   
View Full Code Here

   
    // If keysIn is null or empty, then nothing to fetch.
    if ((keysIn == null) || (keysIn.size() == 0))
      return Collections.emptyList();

    DynamicQuery dynamicQry = new DynamicQuery(selectSQL);
    appendSortTables(dynamicQry);
    dynamicQry.appendInListWithAnd(ENTITY_ALIAS + "." + KEY_NAME, keysIn);
    if (restrictions != null && restrictions.length > 0)
      dynamicQry.AND().pad().appendGroupedAnd(restrictions);
   
    appendSortCriteria(dynamicQry, fq);

    log.debug(dynamicQry);
   
View Full Code Here

      return keysIn;
   
    if (publisher == null)
      return keysIn;
   
    DynamicQuery dynamicQry = new DynamicQuery(selectSQL);
    appendConditions(dynamicQry, fq, publisher);
    if (restrictions != null && restrictions.length > 0)
      dynamicQry.AND().pad().appendGroupedAnd(restrictions);

    return getQueryResult(em, dynamicQry, keysIn, entityAlias + "." + keyName);
  }
View Full Code Here

   
    // If keysIn is null or empty, then nothing to fetch.
    if ((keysIn == null) || (keysIn.size() == 0))
      return Collections.emptyList();

    DynamicQuery dynamicQry = new DynamicQuery(selectSQL);
    appendSortTables(dynamicQry);
    dynamicQry.appendInListWithAnd(ENTITY_ALIAS + "." + KEY_NAME, keysIn);
    if (restrictions != null && restrictions.length > 0)
      dynamicQry.AND().pad().appendGroupedAnd(restrictions);
   
    appendSortCriteria(dynamicQry, fq);

    log.debug(dynamicQry);
   
View Full Code Here

   
    List<String> tmodelKeys = tModels.getTModelKey();
    if (tmodelKeys == null || tmodelKeys.size() == 0)
      return keysIn;
   
    DynamicQuery dynamicQry = new DynamicQuery(selectSQL);
    appendConditions(dynamicQry, fq, tmodelKeys);
    if (parentKey != null && parentKey.length() > 0)
      dynamicQry.AND().pad().appendGroupedAnd(new DynamicQuery.Parameter(BusinessServiceQuery.ENTITY_ALIAS + "." + BusinessServiceQuery.KEY_NAME_PARENT, parentKey, DynamicQuery.PREDICATE_EQUALS));
      //dynamicQry.AND().pad().appendGroupedAnd(new DynamicQuery.Parameter(BindingTemplateQuery.ENTITY_ALIAS + "." + BindingTemplateQuery.KEY_NAME_PARENT, parentKey, DynamicQuery.PREDICATE_EQUALS));
   
    if (restrictions != null && restrictions.length > 0)
      dynamicQry.AND().pad().appendGroupedAnd(restrictions);
   
    return getQueryResult(em, dynamicQry, keysIn, ENTITY_ALIAS + "." + KEY_NAME);
  }
View Full Code Here

         
          params.add(param);
        }
 
        // Find the associated transfer tokens and remove them.
        DynamicQuery getTokensQry = new DynamicQuery();
        getTokensQry.append("select distinct ttk.transferToken from TransferTokenKey ttk").pad();
        getTokensQry.WHERE().pad().appendGroupedOr(params.toArray(new DynamicQuery.Parameter[0]));
 
        Query qry = getTokensQry.buildJPAQuery(em);
        List<org.apache.juddi.model.TransferToken> tokensToDelete = qry.getResultList();
        if (tokensToDelete != null && tokensToDelete.size() > 0) {
          for (org.apache.juddi.model.TransferToken tt : tokensToDelete)
            em.remove(tt);
        }
View Full Code Here

         
          params.add(param);
        }
 
        // Find the associated transfer tokens and remove them.
        DynamicQuery getTokensQry = new DynamicQuery();
        getTokensQry.append("select distinct ttk.transferToken from TransferTokenKey ttk").pad();
        getTokensQry.WHERE().pad().appendGroupedOr(params.toArray(new DynamicQuery.Parameter[0]));
 
        Query qry = getTokensQry.buildJPAQuery(em);
        List<org.apache.juddi.model.TransferToken> tokensToDelete = qry.getResultList();
        if (tokensToDelete != null && tokensToDelete.size() > 0) {
          for (org.apache.juddi.model.TransferToken tt : tokensToDelete)
            em.remove(tt);
        }
View Full Code Here

      return keysIn;
   
    if (publisher == null)
      return keysIn;
   
    DynamicQuery dynamicQry = new DynamicQuery(selectSQL);
    appendConditions(dynamicQry, fq, publisher);
    if (restrictions != null && restrictions.length > 0)
      dynamicQry.AND().pad().appendGroupedAnd(restrictions);

    return getQueryResult(em, dynamicQry, keysIn, entityAlias + "." + keyName);
  }
View Full Code Here

TOP

Related Classes of org.apache.juddi.query.util.DynamicQuery$Parameter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.