Package org.springframework.jdbc.object

Examples of org.springframework.jdbc.object.BatchSqlUpdate.update()


    batchUpdate.declareParameter(new SqlParameter("target_artist_name", Types.VARCHAR));
    batchUpdate.declareParameter(new SqlParameter("target_track_name", Types.VARCHAR));
    batchUpdate.declareParameter(new SqlParameter("weight", Types.FLOAT));
   
    for (TrackRelation tr : trackRelations) {
      batchUpdate.update(new Object[]{
          sourceTrackId, tr.getTarget().getArtist().getName(),
          tr.getTarget().getName(), tr.getMatch()});
    }
    batchUpdate.flush();
  }
View Full Code Here


    BatchSqlUpdate batchUpdate = new BatchSqlUpdate(jdbcTemplate.getDataSource(), sql);
    batchUpdate.declareParameter(new SqlParameter("parent_path", Types.VARCHAR));
    batchUpdate.declareParameter(new SqlParameter("path", Types.VARCHAR));
   
    for (String subDirectory : subDirectories) {
      batchUpdate.update(new Object[]{directory, subDirectory});
    }
    batchUpdate.flush();

  }
View Full Code Here

    batchUpdate.declareParameter(new SqlParameter("filename", Types.VARCHAR));
    batchUpdate.declareParameter(new SqlParameter("modified", Types.TIMESTAMP));
    batchUpdate.declareParameter(new SqlParameter("size", Types.INTEGER));

    for (File file : files) {
      batchUpdate.update(new Object[]{file.getDirectory(), file.getFilename(),
          file.getModified().toDate(), file.getSize()});
    }
    batchUpdate.flush();

    addMetadata(files);
View Full Code Here

    batch.declareParameter(new SqlParameter("artistsort_name", Types.VARCHAR));
    batch.declareParameter(new SqlParameter("albumartistsort_name", Types.VARCHAR));
    for (File file : files) {
      MetaData md = file.getMetadata();
      if (md != null) {
        batch.update(new Object[]{file.getDirectory(), file.getFilename(),
            md.getMediaType().getFilesuffix(), md.getBitrate(), md.isVbr(),
            md.getDuration(), md.getArtist(), md.getAlbumArtist(),
            md.getComposer(), md.getAlbum(), md.getTitle(), md.getTrackNr(),
            md.getTrackNrs(), md.getDiscNr(), md.getDiscNrs(), md.getYear(),
            md.getGenre(), md.getLyrics(), md.isCoverArtEmbedded(),
View Full Code Here

    batchUpdate.declareParameter(new SqlParameter("format", Types.VARCHAR));
    batchUpdate.declareParameter(new SqlParameter("release_group_mbid", Types.VARCHAR));
   
    for (MBRelease r : releases) {
      if (r.isValid()) {
        batchUpdate.update(new Object[]{r.getArtistId(), r.getTitle(),
          r.getAlbumType().ordinal(), r.getReleaseYear(), r.getLabelName(),
          r.getLabelMbid(), r.getFormat(), r.getReleaseGroupMbid()});
      } else {
        LOG.warn("Invalid MusicBrainz release ignored: " + r);
      }
View Full Code Here

    batchUpdate.declareParameter(new SqlParameter("artist_name", Types.VARCHAR));
    batchUpdate.declareParameter(new SqlParameter("rank", Types.INTEGER));
    batchUpdate.declareParameter(new SqlParameter("days", Types.INTEGER));
   
    for (int i = 0; i < artists.size(); i++) {
      batchUpdate.update(new Object[]{user.getLastFmUsername(),
          artists.get(i).getName(), i, period.getDays()});
    }
    batchUpdate.flush();
  }
View Full Code Here

    batchUpdate.declareParameter(new SqlParameter("lastfm_user", Types.VARCHAR));
    batchUpdate.declareParameter(new SqlParameter("artist_name", Types.VARCHAR));
    batchUpdate.declareParameter(new SqlParameter("track_name", Types.VARCHAR));
   
    for (Track track : lovedTracks) {
      batchUpdate.update(new Object[]{lastFmUsername,
          track.getArtist().getName(), track.getName()});
    }
    batchUpdate.flush();
  }
View Full Code Here

    batchUpdate.declareParameter(new SqlParameter("county_code", Types.VARCHAR));
    batchUpdate.declareParameter(new SqlParameter("start_year", Types.SMALLINT));
    batchUpdate.declareParameter(new SqlParameter("active", Types.BOOLEAN));
   
    for (MBArtist artist : artists) {
      batchUpdate.update(new Object[]{artist.getName(), artist.getMbid(),
          artist.getCountryCode(), artist.getStartYear(), artist.isActive()});
    }
    batchUpdate.flush();
  }
View Full Code Here

    batchUpdate.setBatchSize(1000);
    batchUpdate.declareParameter(new SqlParameter("tag_name", Types.VARCHAR));
    batchUpdate.declareParameter(new SqlParameter("tag_name", Types.VARCHAR));

    for (String tag : tags) {
      batchUpdate.update(new Object[]{tag, tag});
    }
    batchUpdate.flush();
  }

  @Override
View Full Code Here

    batchUpdate.setBatchSize(1000);
    batchUpdate.declareParameter(new SqlParameter("t.tag_name", Types.VARCHAR));
    batchUpdate.declareParameter(new SqlParameter("tc.tag_name", Types.VARCHAR));

    for (String tag : tagCorrections.keySet()) {
      batchUpdate.update(new Object[]{tag, tagCorrections.get(tag)});
    }
    batchUpdate.flush();
  }

  protected String getCreateMissingTagsSql(int tags) {
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.