Package javax.persistence

Examples of javax.persistence.Query.executeUpdate()


    }

    protected void clearDayHitsByWebsite(Weblog website) throws WebloggerException {
        Query query = strategy.getNamedUpdate("WeblogReferrer.clearDayHitsByWebsite");
        query.setParameter(1, website);
        query.executeUpdate();
    }

    protected List getBlackListedReferer(String[] blacklist) throws
            WebloggerException {
        StringBuffer queryString = getQueryStringForBlackList(blacklist);
View Full Code Here


       
        // delete all bad counts
        Query removeq = strategy.getNamedUpdate(
                "WeblogEntryTagAggregate.removeByTotalLessEqual");
        removeq.setParameter(1, new Integer(0));
        removeq.executeUpdate();
    }
   
    /**
     * @inheritDoc
     */
 
View Full Code Here

    /**
     * @inheritDoc
     */
    public void resetAllHitCounts() throws WebloggerException {      
        Query q = strategy.getNamedUpdate("WeblogHitCount.updateDailyHitCountZero");
        q.executeUpdate();
    }
   
    /**
     * @inheritDoc
     */
 
View Full Code Here

    public void removeAutoPing(PingTarget pingTarget, Weblog website) throws WebloggerException {
        Query q = strategy.getNamedUpdate("AutoPing.removeByPingTarget&Website");
        q.setParameter(1, pingTarget);
        q.setParameter(2, website);
        q.executeUpdate();
    }

    public void removeAutoPings(Collection autopings) throws WebloggerException {
        strategy.removeAll(autopings);
    }
View Full Code Here

       
        // delete all weblog tag aggregates
        Query removeAggs= strategy.getNamedUpdate(
                "WeblogEntryTagAggregate.removeByWeblog");
        removeAggs.setParameter(1, website);
        removeAggs.executeUpdate();
       
        // delete all bad counts
        Query removeCounts = strategy.getNamedUpdate(
                "WeblogEntryTagAggregate.removeByTotalLessEqual");
        removeCounts.setParameter(1, new Integer(0));
View Full Code Here

       
        // delete all bad counts
        Query removeCounts = strategy.getNamedUpdate(
                "WeblogEntryTagAggregate.removeByTotalLessEqual");
        removeCounts.setParameter(1, new Integer(0));
        removeCounts.executeUpdate();
       
       
        // Remove the website's ping queue entries
        Query q = strategy.getNamedQuery("PingQueueEntry.getByWebsite");
        q.setParameter(1, website);
View Full Code Here

                    entityManager.remove(pair);
            } else {
                // delete all entities
                Query query = entityManager.createQuery("DELETE FROM KVPair k");

                query.executeUpdate();
            }
        } else if (keyIsValid) {
            KVPair pair = entityManager.find(KVPair.class, key);

            if (pair == null) {
View Full Code Here

  }

  private static void deleteAllExistingData(EntityManager em) {
    log.info("Deleting existing books");
    Query bookQuery = em.createQuery("delete from Book");
    bookQuery.executeUpdate();
   
    Query authorQuery = em.createQuery("delete from Author");
    authorQuery.executeUpdate();
   
    log.info("Deleting existing authors");
View Full Code Here

    log.info("Deleting existing books");
    Query bookQuery = em.createQuery("delete from Book");
    bookQuery.executeUpdate();
   
    Query authorQuery = em.createQuery("delete from Author");
    authorQuery.executeUpdate();
   
    log.info("Deleting existing authors");
 
}
View Full Code Here

            update = "update Employee a set a.hireTimestamp = {ts '2009-08-25 00:00:00.123'} where a.empId = 1";
        } else {
            update = "update Employee a set a.hireTimestamp = {ts '2009-08-25 00:00:00.123456'} where a.empId = 1";
        }
        Query q = em.createQuery(update);
        int updateCnt = q.executeUpdate();
        em.getTransaction().commit();
        Assert.assertEquals(1, updateCnt);
        em.close();
    }
   
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.