Examples of createQuery()


Examples of org.hibernate.search.FullTextSession.createQuery()

            String query = "select o from " + entityClass.getName() + " o fetch all properties";
            if (WikiNode.class.isAssignableFrom(entityClass)) {
                // If it's a WikiNode, fetch the associated User instances, avoiding N+1 selects
                query = "select o from " + entityClass.getName() + " o inner join fetch o.createdBy left join fetch o.lastModifiedBy fetch all properties";
            }
            ScrollableResults cursor = ftSession.createQuery(query).scroll();

            cursor.last();
            int count = cursor.getRowNumber() + 1;
            log.debug("total documents in database: " + count);
View Full Code Here

Examples of org.hibernate.search.jpa.FullTextEntityManager.createQuery()

    }
    em.getTransaction().commit();
    em.clear();

    em.getTransaction().begin();
    assertEquals( 1000, em.createQuery( "delete from " + Clock.class.getName() ).executeUpdate() );
    em.getTransaction().commit();

    em.close();

  }
View Full Code Here

Examples of org.keycloak.events.EventStoreProvider.createQuery()

                                 @QueryParam("ipAddress") String ipAddress, @QueryParam("first") Integer firstResult, @QueryParam("max") Integer maxResults) {
        auth.init(RealmAuth.Resource.EVENTS).requireView();

        EventStoreProvider eventStore = session.getProvider(EventStoreProvider.class);

        EventQuery query = eventStore.createQuery().realm(realm.getId());
        if (client != null) {
            query.client(client);
        }
        if (type != null) {
            query.type(EventType.valueOf(type));
View Full Code Here

Examples of org.modeshape.jcr.api.query.QueryManager.createQuery()

    @Test
    public void shouldFindBuiltInNodeTypes() throws Exception {
        String queryString = "select [jcr:path] from [nt:base] where ischildnode('/jcr:system/jcr:nodeTypes')";
        QueryManager queryManager = session.getWorkspace().getQueryManager();
        Query query = queryManager.createQuery(queryString, Query.JCR_SQL2);
        QueryResult result = query.execute();
        long numNodetypes = session.getWorkspace().getNodeTypeManager().getAllNodeTypes().getSize();
        validateQuery().rowCount(numNodetypes).validate(query, result);
    }
View Full Code Here

Examples of org.modeshape.jcr.api.query.qom.QueryObjectModelFactory.createQuery()

        columns[0] = qomFactory.column("node", "notion:booleanProperty", "notion:booleanProperty");
        columns[1] = qomFactory.column("node", "notion:booleanProperty2", "notion:booleanProperty2");
        Ordering[] orderings = null;

        // Build and execute the query ...
        Query query = qomFactory.createQuery(selector, constraint, orderings, columns);
        assertThat(query, is(notNullValue()));
        QueryResult result = query.execute();
        String[] columnNames = {"notion:booleanProperty", "notion:booleanProperty2"};
        validateQuery().rowCount(numResults).hasColumns(columnNames).validate(query, result);
    }
View Full Code Here

Examples of org.mongodb.morphia.Datastore.createQuery()

    @After
    public void clearFongo() {
        Datastore ds = new DynamicProjectRepository().getDatastore();

        ds.delete(ds.createQuery(DbBackedProject.class));
        ds.delete(ds.createQuery(DbBackedBuild.class));
        ds.getDB().getCollection(GithubAccessTokenRepository.COLLECTION_NAME).remove(new BasicDBObject());
    }

    @Test
View Full Code Here

Examples of org.mongodb.morphia.testdaos.HotelDAO.createQuery()

        hotelDAO.save(hilton);

        final List<Hotel> allHotels = hotelDAO.find().asList();
        assertEquals(2, allHotels.size());

        assertEquals(1, hotelDAO.find(hotelDAO.createQuery().offset(1).limit(10)).asList().size());
        assertEquals(1, hotelDAO.find(hotelDAO.createQuery().limit(1)).asList().size());
        assertTrue(hotelDAO.exists("type", Hotel.Type.BUSINESS));
        assertNotNull(hotelDAO.findOne("type", Hotel.Type.LEISURE));

        // try updating
View Full Code Here

Examples of org.mongolink.domain.criteria.Criteria.createQuery()

        AggregateMapper<FakeAggregate> mapper = (AggregateMapper<FakeAggregate>) context.mapperFor(FakeAggregate.class);
        Criteria criteria = new Criteria(mock(QueryExecutor.class));

        mapper.applyRestrictionsFor(FakeAggregate.class, criteria);

        DBObject query = criteria.createQuery();
        assertThat(query.get("$or"), notNullValue());
        BasicDBList or = (BasicDBList) query.get("$or");
        assertThat(or.size(), is(2));
    }
View Full Code Here

Examples of org.olat.core.commons.persistence.DB.createQuery()

      // Original comment has been deleted in the meantime. Don't delete it again.
      return 0;
    }
    DB db = DBFactory.getInstance();
    // First deal with all direct replies
    DBQuery query = db.createQuery("select comment from UserCommentImpl as comment where parent=:parent");
    query.setEntity("parent", comment);
    List<UserComment> replies = query.list();
    if (deleteReplies) {
      // Since we have a many-to-one we first have to recursively delete
      // the replies to prevent foreign key constraints
View Full Code Here

Examples of org.openbp.server.persistence.PersistenceContext.createQuery()

    {
      LogUtil.debug(getClass(), "Performing token query (all tokens).");
    }

    PersistenceContext pc = getPersistenceContext();
    PersistenceQuery query = pc.createQuery(TokenContext.class);

    if (criteria != null)
    {
      configureCriterion(query, criteria);
    }
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.