public boolean delete(String sourceType, String source, String targetType, String target) { int n = jdbc.update("delete from "+TABLE+" where "+COL_ID_TYPE+"=? and "+COL_ID+"=? and "+ COL_TARGET_TYPE+"=? and "+COL_TARGET+"=?", sourceType, source, targetType, target); if (n == 1) return true; return false; }
/** *{@inheritDoc} */ @Override public boolean deleteTask(long taskId) { int affectedRows = simpleJdbcTemplate.update(SQL_DELETE_TASK, taskId); return (affectedRows > 0); }
@PostConstruct void init() { try { jdbcTemplate.update("drop table event if exists"); jdbcTemplate.update("drop table event_stream if exists"); jdbcTemplate.update("create table event_stream(id varchar primary key, type varchar not null, version bigint not null, timestamp timestamp not null, next_event_sequence bigint not null)"); jdbcTemplate.update("create table event(event_stream_id varchar not null, sequence_number bigint not null, version bigint not null, timestamp timestamp not null, data varchar not null, " + "primary key (event_stream_id, sequence_number), foreign key (event_stream_id) references event_stream (id))"); } catch (DataAccessException ex) { LOG.info("init database exception", ex); } }
/** * * @see org.kuali.kfs.module.bc.batch.dataaccess.BudgetConstructionHumanResourcesPayrollInterfaceDao#buildBudgetConstructionAdministrativePosts(java.lang.Integer) */ public void buildBudgetConstructionAdministrativePosts() { /** * this unrealistic implementation will simply clean out what is already there */ String sqlString = new String("DELETE FROM LD_BCN_ADM_POST_T\n"); getSimpleJdbcTemplate().update(sqlString); }
/** * @see org.kuali.kfs.module.bc.document.dataaccess.OrganizationBCDocumentSearchDao#buildBudgetedAccountsAbovePointsOfView(java.lang.String, * java.lang.Integer, java.lang.String, java.lang.String) */ public int buildBudgetedAccountsAbovePointsOfView(String principalName, Integer universityFiscalYear, String chartOfAccountsCode, String organizationCode) { LOG.debug("buildBudgetedAccountsAbovePointsOfView() started"); int rowsAffected = getSimpleJdbcTemplate().update(buildBudgetedAccountsAbovePointsOfView[0], principalName, principalName, universityFiscalYear, chartOfAccountsCode, organizationCode); return rowsAffected; }
/** * Removes all cost share entries from the temporary holding table for this unique inquiry * * @param tableName the name of the temporary table to remove cost share entries from * @param sessionIdColumn the name of the column in the temporary table that holds the unique id of the inquiry * @param sessionId the unique id of the web session of the inquiring user */ protected void purgeCostShareEntries(String tableName, String sessionIdColumn, String sessionId) { getSimpleJdbcTemplate().update("DELETE FROM " + tableName + " WHERE " + sessionIdColumn + " = ? " + " AND EXISTS (SELECT 1 FROM CA_A21_SUB_ACCT_T a " + " WHERE a.fin_coa_cd = " + tableName + ".fin_coa_cd AND a.account_nbr = " + tableName + ".account_nbr AND a.sub_acct_nbr = " + tableName + ".sub_acct_nbr AND a.sub_acct_typ_cd = 'CS')", sessionId); }
/** * Updates the fiscal year and account numbers of temporary pending entries for display * * @param universityFiscalYear the fiscal year to update all the temporary pending entries of this inquiry to * @param sessionId the unique web id of the inquiring user */ protected void fixPendingEntryDisplay(Integer universityFiscalYear, String sessionId) { getSimpleJdbcTemplate().update("update GL_PENDING_ENTRY_MT set univ_fiscal_yr = ? where SESID = ?", universityFiscalYear, sessionId); getSimpleJdbcTemplate().update("update GL_PENDING_ENTRY_MT set SUB_ACCT_NBR = '-----' where (SUB_ACCT_NBR is null or SUB_ACCT_NBR = ' ')"); }
/** * @see org.kuali.kfs.gl.dataaccess.SufficientFundRebuildDao#populateSufficientFundRebuild() */ public void populateSufficientFundRebuild() { getSimpleJdbcTemplate().update("INSERT INTO GL_SF_REBUILD_T (FIN_COA_CD, ACCT_NBR_FOBJ_CD, acct_fobj_typ_cd, obj_id, ver_nbr) "+ "(SELECT FIN_COA_CD, ACCOUNT_NBR, 'A', obj_id, 1 FROM CA_ACCOUNT_T WHERE ACCT_CLOSED_IND = 'N')"); }
public void addSpitter(Spitter spitter) { Map<String, Object> params = new HashMap<String, Object>(); params.put("username", spitter.getUsername()); params.put("password", spitter.getPassword()); params.put("fullname", spitter.getFullName()); jdbcTemplate.update(SQL_INSERT_SPITTER, params); // spitter.setId(queryForIdentity()); }
/** * * get detailed salary/FTE rows by person and organization for the continuing people to be reported * @param principalName * @param idForSession */ protected void fetchIndividualDetailForContinuingPeople(String principalName, String idForSession) { // salaries and FTE by EMPLID and organization for people in the payroll in the base budget year getSimpleJdbcTemplate().update(updateReportsReasonStatisticsTable.get(8).getSQL(), idForSession, principalName, idForSession); }
protected void initSelectedPositionOrgs(String sessionId, String principalName) { int currentLevel = 0; int rowsAffected = getSimpleJdbcTemplate().update(initSelectedPositionOrgsTemplates[0], sessionId, currentLevel, principalName); if (rowsAffected > 0) { populateSelectedPositionOrgsSubTree(currentLevel, sessionId); } }
/** * @see org.kuali.kfs.module.bc.document.dataaccess.ReportDumpDao#updateAccountDump(java.lang.String) */ public void updateAccountDump(String principalId) { cleanAccountDump(principalId); // rebuild account dump table getSimpleJdbcTemplate().update(updateAccountDump, principalId, principalId); }
/** * @see org.kuali.kfs.module.bc.document.dataaccess.BudgetReportsControlListDao#updateReportsObjectCodeSelectList(java.lang.String) */ public void updateReportsObjectCodeSelectList(String principalName) { // clear out previous object code list for user clearTempTableByUnvlId("LD_BCN_OBJ_PICK_T", "PERSON_UNVL_ID", principalName); // rebuild object code list getSimpleJdbcTemplate().update(updateReportsObjectCodeSelectList, principalName, principalName); }
/** * * build a list of all salaries which this user can see * @param principalName--the user requesting the list */ protected void updateReportsPositionFundingDetailTableWithAllData(String principalName) { // get rid of any previous reporting data from this user cleanReportsPositionFundingDetailTable(principalName); // dump all the data this user is authorized to report on into the reporting table getSimpleJdbcTemplate().update(updateReportsPositionFundingDetailTable.get(3).getSQL(), principalName, principalName); }
/** * @see org.kuali.kfs.module.bc.document.dataaccess.BudgetReportsControlListDao#updateObjectCodeSelectFlags(java.util.List) */ public void updateObjectCodeSelectFlags(List<BudgetConstructionObjectPick> objectCodePickList) { for (BudgetConstructionObjectPick budgetConstructionObjectPick : objectCodePickList) { getSimpleJdbcTemplate().update(updateReportsSelectedObjectCodeFlags, budgetConstructionObjectPick.getSelectFlag().intValue(), budgetConstructionObjectPick.getPrincipalId(), budgetConstructionObjectPick.getFinancialObjectCode()); } }
public void saveSpittle(Spittle spittle) { getSimpleJdbcTemplate().update(SQL_INSERT_SPITTLE, new Object[]{ spittle.getSpitter().getId(), spittle.getText(), new Date() }); }
public void addSpitter(Spitter spitter) { getSimpleJdbcTemplate().update( SQL_INSERT_SPITTER, new Object[]{spitter.getUsername(), spitter.getPassword(), spitter.getFullName()}); // spitter.setId(queryForIdentity()); }
public void addSpitter(Spitter spitter) { jdbcTemplate.update(SQL_INSERT_SPITTER, spitter.getUsername(), spitter.getPassword(), spitter.getFullName(), spitter.getEmail(), spitter.isUpdateByEmail()); System.out.println("Counts:" + queryForIdentity()); // spitter.setId(queryForIdentity()); }
public void saveSpitter(Spitter spitter) { jdbcTemplate.update(SQL_UPDATE_SPITTER, spitter.getUsername(), spitter.getPassword(), spitter.getFullName(), spitter.getEmail(), spitter.getId()); }
@Override public Book updateBook(Book bookToUpdate) { this.log.infof("Updating book [%s]", bookToUpdate); this.jdbcTemplate.update( "UPDATE books SET isbn = :isbn, author = :author, title = :title WHERE id = :id", createParameterSourceFor(bookToUpdate)); this.log.infof("Book [%s] updated", bookToUpdate); return bookToUpdate; }