Package org.springframework.jdbc.core.namedparam

Examples of org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.update()


      }
    }
    else {
      params.addValue("overviewId", overview.getOverviewId());
      NamedParameterJdbcTemplate namedTemplate = new NamedParameterJdbcTemplate(template);
      namedTemplate.update(OVERVIEW_UPDATE, params);
    }

    if (this.cascadeType != null && this.cascadeType.equals(CascadeType.PERSIST)) {
      if (!overview.getNotes().isEmpty()) {
        for (Note n : overview.getNotes()) {
View Full Code Here


  )
  public boolean remove(Project project) throws IOException {
    NamedParameterJdbcTemplate namedTemplate = new NamedParameterJdbcTemplate(template);
    boolean ok = true;
    if (project.isDeletable() &&
        (namedTemplate.update(PROJECT_DELETE,
                              new MapSqlParameterSource().addValue("projectId", project.getProjectId())) == 1)) {
      if (!project.getSamples().isEmpty()) {
        for (Sample s : project.getSamples()) {
          ok = sampleDAO.remove(s);
        }
View Full Code Here

  }

  public boolean removeOverview(ProjectOverview overview) throws IOException {
    NamedParameterJdbcTemplate namedTemplate = new NamedParameterJdbcTemplate(template);
    return (overview.isDeletable() &&
           (namedTemplate.update(OVERVIEW_DELETE,
                                 new MapSqlParameterSource().addValue("overviewId", overview.getOverviewId())) == 1));
  }

  @Cacheable(cacheName = "projectCache",
             keyGenerator = @KeyGenerator(
View Full Code Here

      libraryQC.setId(newId.longValue());
    }
    else {
      params.addValue("qcId", libraryQC.getId());
      NamedParameterJdbcTemplate namedTemplate = new NamedParameterJdbcTemplate(template);
      namedTemplate.update(LIBRARY_QC_UPDATE, params);
    }

    if (this.cascadeType != null) {
      Library l = libraryQC.getLibrary();
      if (this.cascadeType.equals(CascadeType.PERSIST)) {
View Full Code Here

  }

  public boolean remove(LibraryQC qc) throws IOException {
    NamedParameterJdbcTemplate namedTemplate = new NamedParameterJdbcTemplate(template);
    if (qc.isDeletable() &&
           (namedTemplate.update(LIBRARY_QC_DELETE,
                                 new MapSqlParameterSource().addValue("qcId", qc.getId())) == 1)) {
      Library l = qc.getLibrary();
      if (this.cascadeType.equals(CascadeType.PERSIST)) {
        if (l != null) libraryDAO.save(l);
      }
View Full Code Here

      platform.setPlatformId(newId.longValue());
    }
    else {
      params.addValue("platformId", platform.getPlatformId());
      NamedParameterJdbcTemplate namedTemplate = new NamedParameterJdbcTemplate(template);
      namedTemplate.update(PLATFORM_UPDATE, params);
    }
   
    return platform.getPlatformId();
  }
View Full Code Here

      try {
        if (namingScheme.validateField("name", study.getName())) {
          params.addValue("studyId", study.getId())
                .addValue("name", study.getName());
          NamedParameterJdbcTemplate namedTemplate = new NamedParameterJdbcTemplate(template);
          namedTemplate.update(STUDY_UPDATE, params);
        }
        else {
          throw new IOException("Cannot save Study - invalid field:" + study.toString());
        }
      }
View Full Code Here

          )
  )
  public boolean remove(Study study) throws IOException {
    NamedParameterJdbcTemplate namedTemplate = new NamedParameterJdbcTemplate(template);
    if (study.isDeletable() &&
           (namedTemplate.update(STUDY_DELETE,
                                 new MapSqlParameterSource().addValue("studyId", study.getId())) == 1)) {
      Project p = study.getProject();
      if (this.cascadeType.equals(CascadeType.PERSIST)) {
        if (p!=null) projectDAO.save(p);
      }
View Full Code Here

      poolQC.setId(newId.longValue());
    }
    else {
      params.addValue("qcId", poolQC.getId());
      NamedParameterJdbcTemplate namedTemplate = new NamedParameterJdbcTemplate(template);
      namedTemplate.update(POOL_QC_UPDATE, params);
    }

    if (this.cascadeType != null) {
      Pool l = poolQC.getPool();
      if (this.cascadeType.equals(CascadeType.PERSIST)) {
View Full Code Here

  }

  public boolean remove(PoolQC qc) throws IOException {
    NamedParameterJdbcTemplate namedTemplate = new NamedParameterJdbcTemplate(template);
    if (qc.isDeletable() &&
           (namedTemplate.update(POOL_QC_DELETE,
                                 new MapSqlParameterSource().addValue("qcId", qc.getId())) == 1)) {
      Pool l = qc.getPool();
      if (this.cascadeType.equals(CascadeType.PERSIST)) {
        if (l != null) poolDAO.save(l);
      }
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.