removed unused urlHash field

This commit is contained in:
Athou
2013-07-27 15:45:15 +02:00
parent 3dd4f140e2
commit 60bf96411c
4 changed files with 8 additions and 19 deletions

View File

@@ -72,15 +72,10 @@ public class FeedDAO extends GenericDAO<Feed> {
}
public Feed findByUrl(String url) {
List<Feed> feeds = findByField(Feed_.urlHash, DigestUtils.sha1Hex(url));
Feed feed = Iterables.getFirst(feeds, null);
if (feed != null && StringUtils.equals(url, feed.getUrl())) {
return feed;
}
String normalized = FeedUtils.normalizeURL(url);
feeds = findByField(Feed_.normalizedUrlHash, DigestUtils.sha1Hex(normalized));
feed = Iterables.getFirst(feeds, null);
List<Feed> feeds = findByField(Feed_.normalizedUrlHash, DigestUtils.sha1Hex(normalized));
Feed feed = Iterables.getFirst(feeds, null);
if (feed != null && StringUtils.equals(normalized, feed.getNormalizedUrl())) {
return feed;
}

View File

@@ -29,9 +29,6 @@ public class Feed extends AbstractModel {
@Column(length = 2048, nullable = false)
private String url;
@Column(length = 40, nullable = false)
private String urlHash;
@Column(length = 2048, nullable = false)
private String normalizedUrl;
@@ -199,14 +196,6 @@ public class Feed extends AbstractModel {
this.disabledUntil = disabledUntil;
}
public String getUrlHash() {
return urlHash;
}
public void setUrlHash(String urlHash) {
this.urlHash = urlHash;
}
public String getLastModifiedHeader() {
return lastModifiedHeader;
}

View File

@@ -30,7 +30,6 @@ public class FeedService {
String normalized = FeedUtils.normalizeURL(url);
feed = new Feed();
feed.setUrl(url);
feed.setUrlHash(DigestUtils.sha1Hex(url));
feed.setNormalizedUrl(normalized);
feed.setNormalizedUrlHash(DigestUtils.sha1Hex(normalized));
feed.setDisabledUntil(new Date(0));

View File

@@ -103,7 +103,13 @@
<changeSet author="athou" id="drop-last-update-success">
<dropIndex tableName="FEEDS" indexName="disabled_lastupdated_index" />
<dropIndex tableName="FEEDS" indexName="lastupdated_index" />
<dropColumn tableName="FEEDS" columnName="lastUpdateSuccess" />
</changeSet>
<changeSet author="athou" id="drop-url-hash">
<dropIndex tableName="FEEDS" indexName="urlHash_index" />
<dropColumn tableName="FEEDS" columnName="urlHash" />
</changeSet>
</databaseChangeLog>