Package javax.persistence

Examples of javax.persistence.Query.executeUpdate()


    public void removeAllMessages(ConnectionContext context) throws IOException {
        EntityManager manager = adapter.beginEntityManager(context);
        try {
            Query query = manager.createQuery("delete from StoredMessage m where m.destination=?1");
            query.setParameter(1, destinationName);
            query.executeUpdate();
        } catch (Throwable e) {
            adapter.rollbackEntityManager(context, manager);
            throw IOExceptionSupport.create(e);
        }
        adapter.commitEntityManager(context, manager);
View Full Code Here


    public void removeMessage(ConnectionContext context, MessageAck ack) throws IOException {
        EntityManager manager = adapter.beginEntityManager(context);
        try {
            Query query = manager.createQuery("delete from StoredMessage m where m.id=?1");
            query.setParameter(1, ack.getLastMessageId().getBrokerSequenceId());
            query.executeUpdate();
        } catch (Throwable e) {
            adapter.rollbackEntityManager(context, manager);
            throw IOExceptionSupport.create(e);
        }
        adapter.commitEntityManager(context, manager);
View Full Code Here

    public void deleteAllMessages() throws IOException {
        EntityManager manager = beginEntityManager(null);
        try {
            Query query = manager.createQuery("delete from StoredMessageReference m");
            query.executeUpdate();
            query = manager.createQuery("delete from StoredSubscription ss");
            query.executeUpdate();
        } catch (Throwable e) {
            rollbackEntityManager(null, manager);
            throw IOExceptionSupport.create(e);
View Full Code Here

        EntityManager manager = beginEntityManager(null);
        try {
            Query query = manager.createQuery("delete from StoredMessageReference m");
            query.executeUpdate();
            query = manager.createQuery("delete from StoredSubscription ss");
            query.executeUpdate();
        } catch (Throwable e) {
            rollbackEntityManager(null, manager);
            throw IOExceptionSupport.create(e);
        }
        commitEntityManager(null, manager);
View Full Code Here

    public void removeAllMessages(ConnectionContext context) throws IOException {
        EntityManager manager = adapter.beginEntityManager(context);
        try {
            Query query = manager.createQuery("delete from StoredMessageReference m where m.destination=?1");
            query.setParameter(1, destinationName);
            query.executeUpdate();
        } catch (Throwable e) {
            adapter.rollbackEntityManager(context, manager);
            throw IOExceptionSupport.create(e);
        }
        adapter.commitEntityManager(context, manager);
View Full Code Here

    public void removeMessage(ConnectionContext context, MessageAck ack) throws IOException {
        EntityManager manager = adapter.beginEntityManager(context);
        try {
            Query query = manager.createQuery("delete from StoredMessageReference m where m.id=?1");
            query.setParameter(1, ack.getLastMessageId().getBrokerSequenceId());
            query.executeUpdate();
        } catch (Throwable e) {
            adapter.rollbackEntityManager(context, manager);
            throw IOExceptionSupport.create(e);
        }
        adapter.commitEntityManager(context, manager);
View Full Code Here

        Query q = strategy.getNamedUpdate(
                "WeblogEntry.updateAllowComments&CommentDaysByWebsite");
        q.setParameter(1, website.getDefaultAllowComments());
        q.setParameter(2, new Integer(website.getDefaultCommentDays()));
        q.setParameter(3, website);
        q.executeUpdate();
    }
   
    /**
     * @inheritDoc
     */
 
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

    @Override
    public int unassignWidgetOwner(long userId) {
        Query query = manager.createNamedQuery(Widget.WIDGET_UNASSIGN_OWNER);
        query.setParameter(Widget.PARAM_OWNER, userId);
        return query.executeUpdate();
    }

    /**
     * Sets input as free text search term to a query
     *
 
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.