Skip to content
Browse files

Added temporary check for reindexed in getImageByColor, added reindex…

…ed to update
  • Loading branch information...
1 parent 152ac76 commit 16c907d50d9d05510cfa848f78fd82ab0059f254 @EivindEE committed May 15, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/main/java/edu/uib/info323/dao/ImageDaoMySql.java
View
4 src/main/java/edu/uib/info323/dao/ImageDaoMySql.java
@@ -124,7 +124,7 @@ public Image getImageByImageUri(String imageUri) {
parameterSource.addValue("relative_freq_high" + i, freqList.get(i) + 15);
}
}
- sql.append(" )) LIMIT :start_index, :end_index ");
+ sql.append(" ) WHERE reindexed = 1) LIMIT :start_index, :end_index ");
LOGGER.debug("SQL query to run: " + sql.toString());
long startTime = System.currentTimeMillis();
List<Image> imagesWithDuplicates = jdbcTemplate.query(sql.toString(),parameterSource, new RowMapper<Image>() {
@@ -240,7 +240,7 @@ public void setDataSource(DataSource dataSource) {
}
public void update(List<Image> images) {
- String sql = "UPDATE image SET height = :height, width = :width , date_analyzed = :date_analyzed WHERE id = :id";
+ String sql = "UPDATE image SET height = :height, width = :width , date_analyzed = :date_analyzed, reindexed = 1 WHERE id = :id";
jdbcTemplate.batchUpdate(sql, this.getSqlParameterSource(images));
}

0 comments on commit 16c907d

Please sign in to comment.
Something went wrong with that request. Please try again.