Examples of deleteById()


Examples of com.github.jmkgreen.morphia.testdaos.HotelDAO.deleteById()

        // try updating
        UpdateOperations<Hotel> mods = hotelDAO.createUpdateOperations().inc("stars", 1);
        hotelDAO.update(hotelDAO.createQuery().filter("stars", 4), mods);
        assertEquals(2, hotelDAO.count(hotelDAO.createQuery().filter("stars", 5)));

        hotelDAO.deleteById(borg.getId());
        assertEquals(1, hotelDAO.count());

        hotelDAO.getCollection().drop();
        assertEquals(0, hotelDAO.count());
    }
View Full Code Here

Examples of info.archinnov.achilles.internal.context.facade.PersistenceManagerOperations.deleteById()

        Validator.validateNotNull(entityClass, "The entity class should not be null for removal by id");
        Validator.validateNotNull(primaryKey, "The primary key should not be null for removal by id");

        PersistenceManagerOperations context = initPersistenceContext(entityClass, primaryKey, options);
        entityValidator.validatePrimaryKey(context.getIdMeta(), primaryKey);
        return context.deleteById();
    }

    protected <T> AchillesFuture<T> asyncFind(final Class<T> entityClass, final Object primaryKey, Options options) {
        Validator.validateNotNull(entityClass, "Entity class should not be null for find by id");
        Validator.validateNotNull(primaryKey, "Entity primaryKey should not be null for find by id");
View Full Code Here

Examples of org.apache.solr.client.solrj.SolrServer.deleteById()

        if (operation.equalsIgnoreCase(SolrConstants.OPERATION_INSERT)) {
            insert(exchange, serverToUse);
        } else if (operation.equalsIgnoreCase(SolrConstants.OPERATION_INSERT_STREAMING)) {
            insert(exchange, serverToUse);
        } else if (operation.equalsIgnoreCase(SolrConstants.OPERATION_DELETE_BY_ID)) {
            serverToUse.deleteById(exchange.getIn().getBody(String.class));
        } else if (operation.equalsIgnoreCase(SolrConstants.OPERATION_DELETE_BY_QUERY)) {
            serverToUse.deleteByQuery(exchange.getIn().getBody(String.class));
        } else if (operation.equalsIgnoreCase(SolrConstants.OPERATION_ADD_BEAN)) {
            serverToUse.addBean(exchange.getIn().getBody());
        } else if (operation.equalsIgnoreCase(SolrConstants.OPERATION_ADD_BEANS)) {
View Full Code Here

Examples of org.apache.solr.client.solrj.SolrServer.deleteById()

        }
       
        boolean isSuccess = false;
        try {
            SolrServer solrClient = this.getSolrClient();
            solrClient.deleteById(ids, COMMIT_WITHIN_MS);
            isSuccess = true;
        } catch (SolrServerException e) {
            logger.error("Delete indexs by ids fail!", e);
        } catch (IOException e) {
            logger.error("Delete indexs by ids fail!", e);
View Full Code Here

Examples of org.apache.solr.client.solrj.SolrServer.deleteById()

        }
       
        boolean isSuccess = false;
        try {
            SolrServer solrClient = this.getSolrClient();
            solrClient.deleteById(id, COMMIT_WITHIN_MS);
            isSuccess = true;
        } catch (SolrServerException e) {
            logger.error("Delete index by id fail!", e);
        } catch (IOException e) {
            logger.error("Delete indexs by id fail!", e);
View Full Code Here

Examples of org.apache.solr.client.solrj.SolrServer.deleteById()

        .withRecordColumns("fam.value").create();

    assertTotalResults(table, "rowid:0", 1l);
    assertTotalResults(table, "rowid:1", 1l);

    server.deleteById("1");

    assertTotalResults(table, "rowid:0", 1l);
    assertTotalResults(table, "rowid:1", 0l);

    removeTable(table);
View Full Code Here

Examples of org.apache.solr.client.solrj.SolrServer.deleteById()

        .withRecordColumns("fam.value").create();

    assertTotalResults(table, "rowid:1", 1l);
    assertTotalResults(table, "rowid:2", 1l);
    List<String> ids = Lists.newArrayList("1", "2", "3", "4", "5");
    server.deleteById(ids);

    for (String id : ids) {
      assertTotalResults(table, "rowid:" + id, 0l);
    }
View Full Code Here

Examples of org.apache.solr.client.solrj.SolrServer.deleteById()

        if (id == null || id.isEmpty()) return;
        SolrServer solrServer = SolrCoreManager.getInstance(bundleContext, managedSolrServer).getServer(
            ldProgramName);
        removeEnhancements(id);
        try {
            solrServer.deleteById(id);
            solrServer.commit();
        } catch (SolrServerException e) {
            log.error("Solr Server Exception", e);
            throw new StoreException(e.getMessage(), e);
        } catch (IOException e) {
View Full Code Here

Examples of org.apache.solr.client.solrj.SolrServer.deleteById()

            String id = idList.get(i);
            idList.remove(i);
            idList.add(i, id);
        }
        try {
            solrServer.deleteById(idList);
            solrServer.commit();
        } catch (SolrServerException e) {
            log.error("Solr Server Exception", e);
            throw new StoreException(e.getMessage(), e);
        } catch (IOException e) {
View Full Code Here

Examples of org.apache.solr.client.solrj.SolrServer.deleteById()

        if (id == null || id.isEmpty()) return;
        SolrServer solrServer = SolrCoreManager.getInstance(bundleContext, managedSolrServer).getServer(
            ldProgramName);
        removeEnhancements(id);
        try {
            solrServer.deleteById(id);
            solrServer.commit();
        } catch (SolrServerException e) {
            log.error("Solr Server Exception", e);
            throw new StoreException(e.getMessage(), e);
        } catch (IOException e) {
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.