Package org.apache.juddi.query.util

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


   
    List<String> tmodelKeys = tModels.getTModelKey();
    if (tmodelKeys == null || tmodelKeys.isEmpty())
      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


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

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

    List<?> restrictionList = keysIn;
    List<?> curResult = null;
    for (KeyedReferenceGroup keyedRefGroup : keyedRefGroups) {
      String curTModelKey = keyedRefGroup.getTModelKey();
     
      DynamicQuery dynamicQry = new DynamicQuery(selectSQL);
      appendConditions(dynamicQry, fq, keyedRefGroup);
      if (restrictions != null && restrictions.length > 0)
        dynamicQry.AND().pad().appendGroupedAnd(restrictions);
     

      if (fq.isOrLikeKeys()) {
        if (!curTModelKey.equals(prevTModelKey)) {
          if (count != 0) {
View Full Code Here

   
    List<String> tmodelKeys = tModels.getTModelKey();
    if (tmodelKeys == null || tmodelKeys.isEmpty())
      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

      maxRows = AppConfig.getConfiguration().getInteger(Property.JUDDI_MAX_ROWS, DEFAULT_MAXROWS);
    }
    catch(ConfigurationException ce) {
      log.error("Configuration exception occurred retrieving: " + Property.JUDDI_MAX_ROWS);
    }
    DynamicQuery dynamicQry = new DynamicQuery(selectSQL);
    if (keysIn.size() > maxRows) {
      UUID uuid = UUID.randomUUID();
      storeIntermediateKeySetResults(em, uuid.toString(), keysIn);
      appendTempTable(dynamicQry);
      appendSortTables(dynamicQry);
      appendTempJoin(dynamicQry, uuid.toString());
    }
    else {
      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

    this.keyGeneratorKeys = keyGeneratorKeys;
  }

  @SuppressWarnings("unchecked")
  public void populateKeyGeneratorKeys(EntityManager em) {
    DynamicQuery getKeysQuery = new DynamicQuery();
    getKeysQuery.append("select t.entityKey from Tmodel t").pad().WHERE().pad();

    DynamicQuery.Parameter pubParam = new DynamicQuery.Parameter("t.authorizedName",
         getAuthorizedName(),
         DynamicQuery.PREDICATE_EQUALS);

    DynamicQuery.Parameter keyParam = new DynamicQuery.Parameter("UPPER(t.entityKey)",
         (DynamicQuery.WILDCARD + KeyGenerator.KEYGENERATOR_SUFFIX).toUpperCase(),
         DynamicQuery.PREDICATE_LIKE);
   
   
    getKeysQuery.appendGroupedAnd(pubParam, keyParam);
    Query qry = getKeysQuery.buildJPAQuery(em);
   
    keyGeneratorKeys = qry.getResultList();
  }
View Full Code Here

            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

      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

      maxRows = AppConfig.getConfiguration().getInteger(Property.JUDDI_MAX_ROWS, DEFAULT_MAXROWS);
    }
    catch(ConfigurationException ce) {
      log.error("Configuration exception occurred retrieving: " + Property.JUDDI_MAX_ROWS);
    }
    DynamicQuery dynamicQry = new DynamicQuery(selectSQL);
    if (keysIn.size() > maxRows) {
      UUID uuid = UUID.randomUUID();
      storeIntermediateKeySetResults(em, uuid.toString(), keysIn);
      appendTempTable(dynamicQry);
      appendSortTables(dynamicQry);
      appendTempJoin(dynamicQry, uuid.toString());
    }
    else {
      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

TOP

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

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.