Package com.serotonin.db.spring

Examples of com.serotonin.db.spring.ExtendedJdbcTemplate.update()


        final ExtendedJdbcTemplate ejt2 = ejt;
        if (se != null) {
            getTransactionTemplate().execute(new TransactionCallbackWithoutResult() {
                @Override
                protected void doInTransactionWithoutResult(TransactionStatus status) {
                    ejt2.update("delete from eventHandlers where eventTypeName=? and eventTypeRef1=?", new Object[] {
                            ScheduledEventType.TYPE_NAME, scheduledEventId });
                    ejt2.update("delete from scheduledEvents where id=?", new Object[] { scheduledEventId });
                }
            });
View Full Code Here


            getTransactionTemplate().execute(new TransactionCallbackWithoutResult() {
                @Override
                protected void doInTransactionWithoutResult(TransactionStatus status) {
                    ejt2.update("delete from eventHandlers where eventTypeName=? and eventTypeRef1=?", new Object[] {
                            ScheduledEventType.TYPE_NAME, scheduledEventId });
                    ejt2.update("delete from scheduledEvents where id=?", new Object[] { scheduledEventId });
                }
            });

            AuditEventType.raiseDeletedEvent(AuditEvent.TYPE_NAME, se);
        }
View Full Code Here

            protected void doInTransactionWithoutResult(TransactionStatus status) {
                if (watchList.getId() == Common.NEW_ID)
                    watchList.setId(doInsert("insert into watchLists (xid, name, userId) values (?,?,?)", new Object[] {
                            watchList.getXid(), watchList.getName(), watchList.getUserId() }));
                else
                    ejt2.update("update watchLists set xid=?, name=? where id=?", new Object[] { watchList.getXid(),
                            watchList.getName(), watchList.getId() });
                ejt2.update("delete from watchListPoints where watchListId=?", new Object[] { watchList.getId() });
                ejt2.batchUpdate("insert into watchListPoints values (?,?,?)", new BatchPreparedStatementSetter() {
                    @Override
                    public int getBatchSize() {
View Full Code Here

                    watchList.setId(doInsert("insert into watchLists (xid, name, userId) values (?,?,?)", new Object[] {
                            watchList.getXid(), watchList.getName(), watchList.getUserId() }));
                else
                    ejt2.update("update watchLists set xid=?, name=? where id=?", new Object[] { watchList.getXid(),
                            watchList.getName(), watchList.getId() });
                ejt2.update("delete from watchListPoints where watchListId=?", new Object[] { watchList.getId() });
                ejt2.batchUpdate("insert into watchListPoints values (?,?,?)", new BatchPreparedStatementSetter() {
                    @Override
                    public int getBatchSize() {
                        return watchList.getPointList().size();
                    }
View Full Code Here

    public void deleteWatchList(final int watchListId) {
        final ExtendedJdbcTemplate ejt2 = ejt;
        getTransactionTemplate().execute(new TransactionCallbackWithoutResult() {
            @Override
            protected void doInTransactionWithoutResult(TransactionStatus status) {
                ejt2.update("delete from watchListPoints where watchListId=?", new Object[] { watchListId });
                ejt2.update("delete from watchListUsers where watchListId=?", new Object[] { watchListId });
                ejt2.update("delete from selectedWatchList where watchListId=?", new Object[] { watchListId });
                ejt2.update("delete from watchLists where id=?", new Object[] { watchListId });
            }
        });
View Full Code Here

        final ExtendedJdbcTemplate ejt2 = ejt;
        getTransactionTemplate().execute(new TransactionCallbackWithoutResult() {
            @Override
            protected void doInTransactionWithoutResult(TransactionStatus status) {
                ejt2.update("delete from watchListPoints where watchListId=?", new Object[] { watchListId });
                ejt2.update("delete from watchListUsers where watchListId=?", new Object[] { watchListId });
                ejt2.update("delete from selectedWatchList where watchListId=?", new Object[] { watchListId });
                ejt2.update("delete from watchLists where id=?", new Object[] { watchListId });
            }
        });
    }
View Full Code Here

        getTransactionTemplate().execute(new TransactionCallbackWithoutResult() {
            @Override
            protected void doInTransactionWithoutResult(TransactionStatus status) {
                ejt2.update("delete from watchListPoints where watchListId=?", new Object[] { watchListId });
                ejt2.update("delete from watchListUsers where watchListId=?", new Object[] { watchListId });
                ejt2.update("delete from selectedWatchList where watchListId=?", new Object[] { watchListId });
                ejt2.update("delete from watchLists where id=?", new Object[] { watchListId });
            }
        });
    }
View Full Code Here

            @Override
            protected void doInTransactionWithoutResult(TransactionStatus status) {
                ejt2.update("delete from watchListPoints where watchListId=?", new Object[] { watchListId });
                ejt2.update("delete from watchListUsers where watchListId=?", new Object[] { watchListId });
                ejt2.update("delete from selectedWatchList where watchListId=?", new Object[] { watchListId });
                ejt2.update("delete from watchLists where id=?", new Object[] { watchListId });
            }
        });
    }

    //
View Full Code Here

            if (WebUtils.hasSubmitParameter(request, "query"))
                query(sqlString, serializedDataMsg, model);
            else if (WebUtils.hasSubmitParameter(request, "update")) {
                ExtendedJdbcTemplate ejt = new ExtendedJdbcTemplate();
                ejt.setDataSource(Common.databaseProxy.getDataSource());
                int result = ejt.update(sqlString);
                model.put("updateResult", result);
            }
            else if (WebUtils.hasSubmitParameter(request, "tables"))
                query(Common.databaseProxy.getTableListQuery(), serializedDataMsg, model);
        }
View Full Code Here

        final ExtendedJdbcTemplate ejt2 = ejt;
        if (me != null) {
            getTransactionTemplate().execute(new TransactionCallbackWithoutResult() {
                @Override
                protected void doInTransactionWithoutResult(TransactionStatus status) {
                    ejt2.update("delete from eventHandlers where eventTypeName=? and eventTypeRef1=?", new Object[] {
                            MaintenanceEventType.TYPE_NAME, maintenanceEventId });
                    ejt2.update("delete from maintenanceEvents where id=?", new Object[] { maintenanceEventId });
                }
            });
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.