Examples of Query


Examples of org.eclipse.bpel.model.messageproperties.Query

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetQuery(Query newQuery, NotificationChain msgs) {
    Query oldQuery = query;
    query = newQuery;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, MessagepropertiesPackage.PROPERTY_ALIAS__QUERY, oldQuery, newQuery);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
View Full Code Here

Examples of org.eclipse.equinox.internal.provisional.p2.query.Query

        HashMap<String, IInstallableUnit> iuMap = new HashMap<String, IInstallableUnit>();

        for (FeatureInfo featureInfo : features) {
            Collector collector = new Collector();
            Query query = new InstallableUnitQuery(featureInfo.getFeatureID(),
                    new VersionRange(Version.create(featureInfo.getFeatureVersion()),
                            true, Version.create(featureInfo.getFeatureVersion()), true));
            collector = RepositoryUtils.getInstallableUnitsInRepositories(null, query, collector, null);
            IInstallableUnit[] units = (IInstallableUnit[]) collector.toArray(IInstallableUnit.class);
View Full Code Here

Examples of org.eclipse.ocl.Query

    /**
     * @generated
     */
    protected Query getQuery() {
      Query oclQuery = null;
      if (this.queryRef != null) {
        oclQuery = (Query) this.queryRef.get();
      }
      if (oclQuery == null) {
        OCLHelper oclHelper = oclInstance.createOCLHelper();
View Full Code Here

Examples of org.eclipse.persistence.internal.jpa.rs.metadata.model.Query

            parameterString.append(";");
            parameterString.append(argument + "={" + argument + "}");
        }

        String version = app.getVersion();
        Query returnQuery = null;
        if (version != null) {
            returnQuery = new Query(query.getName(), jpql, new LinkTemplate("execute", method, app.getBaseURI() + version + "/" + app.getName() + "/query/" + query.getName() + parameterString));
        } else {
            returnQuery = new Query(query.getName(), jpql, new LinkTemplate("execute", method, app.getBaseURI() + app.getName() + "/query/" + query.getName() + parameterString));
        }
        if (query.isReportQuery()) {
            query.checkPrepare((AbstractSession) app.getJpaSession(), new DatabaseRecord());
            for (ReportItem item : ((ReportQuery) query).getItems()) {
                if (item.getMapping() != null) {
                    if (item.getAttributeExpression() != null && item.getAttributeExpression().isMapEntryExpression()) {
                        if (((MapEntryExpression) item.getAttributeExpression()).shouldReturnMapEntry()) {
                            returnQuery.getReturnTypes().add(Map.Entry.class.getSimpleName());
                        } else {
                            returnQuery.getReturnTypes().add(((Class<?>) ((CollectionMapping) item.getMapping()).getContainerPolicy().getKeyType()).getSimpleName());
                        }
                    } else {
                        returnQuery.getReturnTypes().add(item.getMapping().getAttributeClassification().getSimpleName());
                    }
                } else if (item.getResultType() != null) {
                    returnQuery.getReturnTypes().add(item.getResultType().getSimpleName());
                } else if (item.getDescriptor() != null) {
                    returnQuery.getReturnTypes().add(item.getDescriptor().getJavaClass().getSimpleName());
                } else if (item.getAttributeExpression() != null && item.getAttributeExpression().isConstantExpression()) {
                    returnQuery.getReturnTypes().add(((ConstantExpression) item.getAttributeExpression()).getValue().getClass().getSimpleName());
                } else {
                    // Use Object.class by default.
                    returnQuery.getReturnTypes().add(ClassConstants.OBJECT.getSimpleName());
                }
            }
        } else {
            returnQuery.getReturnTypes().add(query.getReferenceClassName() == null ? "" : query.getReferenceClass().getSimpleName());
        }
        return returnQuery;
    }
View Full Code Here

Examples of org.ejbca.util.query.Query

   * @param usermatch a usermatch containing names of profiles
   * @return a query containing id's of profiles.
   * @throws NumberFormatException
   */
  protected Query convertUserMatch(Admin admin, UserMatch usermatch) throws NumberFormatException {
    Query retval = new Query(Query.TYPE_USERQUERY);         
    switch(usermatch.getMatchwith()){
      case UserMatch.MATCH_WITH_ENDENTITYPROFILE:
        String endentityprofilename = Integer.toString(endEntityProfileSession.getEndEntityProfileId(admin,usermatch.getMatchvalue()));
        retval.add(usermatch.getMatchwith(),usermatch.getMatchtype(),endentityprofilename);
        break;
      case UserMatch.MATCH_WITH_CERTIFICATEPROFILE:
        String certificateprofilename = Integer.toString(certificateProfileSession.getCertificateProfileId(admin,usermatch.getMatchvalue()));
        retval.add(usermatch.getMatchwith(),usermatch.getMatchtype(),certificateprofilename);
        break;       
      case UserMatch.MATCH_WITH_CA:
        String caname = Integer.toString(caAdminSession.getCAInfo(admin,usermatch.getMatchvalue()).getCAId());
        retval.add(usermatch.getMatchwith(),usermatch.getMatchtype(),caname);
        break
      case UserMatch.MATCH_WITH_TOKEN:
        String tokenname = Integer.toString(getTokenId(admin,usermatch.getMatchvalue()));
        retval.add(usermatch.getMatchwith(),usermatch.getMatchtype(),tokenname);
        break;
      default:   
        retval.add(usermatch.getMatchwith(),usermatch.getMatchtype(),usermatch.getMatchvalue());
        break;
    }
    return retval;
  }
View Full Code Here

Examples of org.eobjects.metamodel.query.Query

    final Table table = tables[0];

    final DataContextProvider dataContextProvider = _analysisJobBuilder.getDataContextProvider();
    final DataContext dc = dataContextProvider.getDataContext();
    final Query q = dc.query().from(table).select(physicalColumns.toArray(new Column[physicalColumns.size()])).toQuery();
    q.setMaxRows(DEFAULT_PREVIEW_ROWS);

    for (TransformerJobBuilder<?> tjb : transformerJobs) {
      initialize(tjb);
    }
View Full Code Here

Examples of org.exist.atom.modules.Query

                      + ex.getMessage(), ex);
            }

          } else {
            // no class means query
            final Query query = new Query();
            modules.put(name, query);

            final String allowQueryPost = moduleConf.getAttribute("query-by-post");
            if ("true".equals(allowQueryPost)) {
              query.setQueryByPost(true);
            }

            final NodeList methodList = moduleConf.getElementsByTagNameNS(CONF_NS, "method");

            for (int m = 0; m < methodList.getLength(); m++) {
              final Element methodConf = (Element) methodList.item(m);
              final String type = methodConf.getAttribute("type");
              if (type == null) {
                getLog().warn(
                    "No type specified for method in module "
                        + name);
                continue;
              }

              // What I want but can't have because of JDK 1.4
              // URI baseURI =
              // URI.create(methodConf.getBaseURI());
              final URI baseURI = docBaseURI;
              final String queryRef = methodConf.getAttribute("query");
              if (queryRef == null) {
                getLog().warn(
                    "No query specified for method " + type
                        + " in module " + name);
                continue;
              }

              final boolean fromClasspath = "true".equals(methodConf.getAttribute("from-classpath"));
              final Query.MethodConfiguration mconf = query
                  .getMethodConfiguration(type);
              if (mconf == null) {
                getLog().warn(
                    "Unknown method " + type
                        + " in module " + name);
                continue;
              }

              final String responseContentType = methodConf.getAttribute("content-type");
              if (responseContentType != null
                  && responseContentType.trim().length() != 0) {
                mconf.setContentType(responseContentType);
              }

              URL queryURI = null;
              if (fromClasspath) {
                getLog().debug(
                    "Nope. Attempting to get resource "
                        + queryRef + " from "
                        + Atom.class.getName());
                queryURI = Atom.class.getResource(queryRef);

              } else {
                queryURI = baseURI.resolve(queryRef).toURL();
              }

              getLog().debug(
                  "Loading from module " + name + " method "
                      + type + " from resource "
                      + queryURI + " via classpath("
                      + fromClasspath + ") and ref ("
                      + queryRef + ")");

              if (queryURI == null) {
                throw new ServletException(
                    "Cannot find resource " + queryRef
                        + " for module " + name);
              }
              mconf.setQuerySource(queryURI);
            }
            query.init(new ModuleContext(config, name, atomConf
                .getParent()));

          }
        }

      } catch (final IOException e) {
        getLog().warn(e);
        throw new ServletException(e.getMessage());
      } catch (final SAXException e) {
        getLog().warn(e);
        throw new ServletException(e.getMessage());
      } catch (final ParserConfigurationException e) {
        getLog().warn(e);
        throw new ServletException(e.getMessage());
      } catch (final EXistException e) {
        getLog().warn(e);
        throw new ServletException(e.getMessage());
      } finally {
        if (is != null) {
          try {
            is.close();
          } catch (final IOException ex) {
          }
        }
      }

    } else {
      try {
        final AtomProtocol protocol = new AtomProtocol();
        modules.put("edit", protocol);
        protocol.init(new ModuleContext(config, "edit", dbHome.getAbsolutePath()));

        final AtomFeeds feeds = new AtomFeeds();
        modules.put("content", feeds);
        feeds.init(new ModuleContext(config, "content", dbHome.getAbsolutePath()));

        final Query query = new Query();
        query.setQueryByPost(true);
        modules.put("query", query);
        query.init(new ModuleContext(config, "query", dbHome.getAbsolutePath()));

        final Query topics = new Query();
        modules.put("topic", topics);
        topics.getMethodConfiguration("GET").setQuerySource(
            topics.getClass().getResource("topic.xq"));
        topics.init(new ModuleContext(config, "topic", dbHome.getAbsolutePath()));

        final Query introspect = new Query();
        modules.put("introspect", introspect);
        introspect.getMethodConfiguration("GET").setQuerySource(
            introspect.getClass().getResource("introspect.xq"));
        introspect.init(new ModuleContext(config, "introspect", dbHome.getAbsolutePath()));

      } catch (final EXistException ex) {
        throw new ServletException("Exception during module init(): "
            + ex.getMessage(), ex);
      }
View Full Code Here

Examples of org.exist.soap.Query

*/
public class GetDocument {

    public static void main( String[] args ) throws Exception {
        QueryService service = new QueryServiceLocator();
        Query query = service.getQuery();
    String session = query.connect("guest", "guest");
       
    byte[] data = query.getResourceData(session,
        XmldbURI.ROOT_COLLECTION + "/shakespeare/plays/hamlet.xml",
      true, false, false);
    System.out.println(new String(data, "UTF-8"));
    query.disconnect(session);
    }
View Full Code Here

Examples of org.exolab.castor.jdo.Query

        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
        Date loadDate = df.parse("2004-04-26");

        String oql = "select t from " + Entity.class.getName() + " t " + " where t.loadDate=$1";
        Query qry = db.getOQLQuery(oql);
        qry.bind(loadDate);
        QueryResults qrs = qry.execute(AccessMode.ReadOnly);
        while (qrs.hasMore()) {
            Entity entity = (Entity) qrs.next();
            if (LOG.isTraceEnabled()) { LOG.trace(entity); }
        }
       
View Full Code Here

Examples of org.exoplatform.services.database.annotation.Query

      return builder.toString();
   }

   public <T extends DAO<?>> String getQuery(Class<T> clazz, String name) throws Exception
   {
      Query query = clazz.getAnnotation(Query.class);
      String value = null;
      if (query != null && query.name().equals(name))
         value = getQuery(query);
      if (value != null)
         return value;
      List<Method> list = ReflectionUtil.getMethod(clazz, name);
      for (Method method : list)
      {
         query = method.getAnnotation(Query.class);
         if (query != null && query.name().equals(name))
            value = getQuery(query);
         if (value != null)
            return value;
      }
      return null;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.