Examples of createQuery()


Examples of com.liferay.portal.kernel.dao.orm.Session.createQuery()

          query.append(WallEntryModelImpl.ORDER_BY_JPQL);
        }

        String sql = query.toString();

        Query q = session.createQuery(sql);

        QueryPos qPos = QueryPos.getInstance(q);

        qPos.add(groupId);
View Full Code Here

Examples of com.mysql.clusterj.Session.createQuery()

                numberOfThreads * numberOfNewCustomersPerThread * numberOfNewOrdersPerNewCustomer, nextOrderId);
        // double check the orders to make sure they were updated correctly
        Session session = sessionFactory.getSession();
        QueryDomainType<OrderLine> queryOrderType = session.getQueryBuilder().createQueryDefinition(OrderLine.class);
        queryOrderType.where(queryOrderType.get("orderId").equal(queryOrderType.param("orderId")));
        Query<OrderLine> query = session.createQuery(queryOrderType);       
        for (Order order: orders) {
            int orderId = order.getId();
            // replace order with its persistent representation
            order = session.find(Order.class, orderId);
            double expectedTotal = order.getValue();
View Full Code Here

Examples of de.mhus.lib.jpa.JpaEntityManager.createQuery()

    assertTrue(book1 != copyBook1);
   
    // assertTrue(foundBook.is)
   
    {
      JpaQuery<Book> query = em.createQuery("select b from Book b", Book.class);
     
 
      List<Book> list = query.getResultList();
     
      assertTrue(list.size() == 2);
View Full Code Here

Examples of info.magnolia.cms.core.search.QueryManager.createQuery()

        while (catalogIter.hasNext())
        {
            String catalog = (String) catalogIter.next();
            try
            {
                Query q = qm.createQuery("//commands//" + catalog + "//*", Query.XPATH);
                QueryResult qr = q.execute();
                Collection collection = qr.getContent("mgnl:contentNode");
                if (CollectionUtils.isEmpty(collection))
                    continue;
                Iterator commandIter = collection.iterator();
View Full Code Here

Examples of javax.help.search.SearchEngine.createQuery()

    // Get a query for each engine
      for (Enumeration e = mhs.getEngines();
     e.hasMoreElements(); ) {
    SearchEngine engine = (SearchEngine) e.nextElement();
    if (engine != null) {
        queries.addElement(engine.createQuery());
    }
      }
   
      // Set the listener to this class and start the query
      for (Enumeration e = queries.elements(); e.hasMoreElements(); ) {
View Full Code Here

Examples of javax.jcr.query.QueryManager.createQuery()

     */
    private RowIterator execute() {
        try {
            String stmt = translateStatement();
            QueryManager qm = session.getWorkspace().getQueryManager();
            RowIterator nodes = qm.createQuery(stmt, Query.XPATH).execute().getRows();
            if (filter != null) {
                nodes = new FilteredRowIterator(nodes);
            }
            if (offset > 0) {
                try {
View Full Code Here

Examples of javax.jcr.query.qom.QueryObjectModelFactory.createQuery()

    public void testGetChildrenApiDirect() throws Exception {
        QueryObjectModelFactory qomf = qm.getQOMFactory();
        Source source1 = qomf.selector(NodeType.NT_BASE, "selector");
        Column[] columns = new Column[] { qomf.column("selector", null, null) };
        Constraint constraint2 = qomf.childNode("selector", n1.getPath());
        QueryObjectModel qom = qomf.createQuery(source1, constraint2, null,
                columns);
        checkResult(qom.execute(), 2);
    }

    /**
 
View Full Code Here

Examples of javax.persistence.EntityManager.createQuery()

    if (named == null)
      return em.find(getMethodReturnType(), parameters[0]);
    else {
      String ejbql = "from " + getMethodReturnType().getSimpleName() + " entity where entity." + named.value()
              + "=?";
      Query query = em.createQuery(ejbql);
      query.setParameter(1, parameters[0]);
      return query.getSingleResult();
    }
  }
 
View Full Code Here

Examples of javax.persistence.EntityManager.createQuery()

      if (retrieve.resultClass().equals(void.class))
        return em.createNativeQuery(retrieve.query());
      else
        return em.createNativeQuery(retrieve.query(), retrieve.resultClass());
    } else
      return em.createQuery(retrieve.query());
  }
 
  @Override
  protected void initialize() {
    annotationClass = Retrieve.class;
View Full Code Here

Examples of javax.persistence.EntityManager.createQuery()

      if (find.resultClass().equals(void.class))
        return em.createNativeQuery(find.query());
      else
        return em.createNativeQuery(find.query(), find.resultClass());
    } else
      return em.createQuery(find.query());
  }
 
  @Override
  protected void initialize() {
    annotationClass = Find.class;
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.