Merge pull request #3877 from thombergs/mongodb-tagging-remove-article-field

BAEL-1591: removed field "article"
This commit is contained in:
Tom Hombergs 2018-03-25 18:09:12 +02:00 committed by GitHub
commit efa0bcaf85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 32 deletions

View File

@ -15,11 +15,6 @@ public class Post {
*/ */
private String title; private String title;
/**
* Full article.
*/
private String article;
/** /**
* Author of the post. * Author of the post.
*/ */
@ -49,25 +44,6 @@ public class Post {
this.title = title; this.title = title;
} }
/**
* Gets the {@link #article}.
*
* @return the {@link #article}
*/
public String getArticle() {
return article;
}
/**
* Sets the {@link #article}.
*
* @param article
* the new {@link #article}
*/
public void setArticle(String article) {
this.article = article;
}
/** /**
* Gets the {@link #author}. * Gets the {@link #author}.
* *
@ -115,7 +91,6 @@ public class Post {
public int hashCode() { public int hashCode() {
final int prime = 31; final int prime = 31;
int result = 1; int result = 1;
result = prime * result + ((article == null) ? 0 : article.hashCode());
result = prime * result + ((author == null) ? 0 : author.hashCode()); result = prime * result + ((author == null) ? 0 : author.hashCode());
result = prime * result + ((tags == null) ? 0 : tags.hashCode()); result = prime * result + ((tags == null) ? 0 : tags.hashCode());
result = prime * result + ((title == null) ? 0 : title.hashCode()); result = prime * result + ((title == null) ? 0 : title.hashCode());
@ -136,11 +111,6 @@ public class Post {
if (getClass() != obj.getClass()) if (getClass() != obj.getClass())
return false; return false;
Post other = (Post) obj; Post other = (Post) obj;
if (article == null) {
if (other.article != null)
return false;
} else if (!article.equals(other.article))
return false;
if (author == null) { if (author == null) {
if (other.author != null) if (other.author != null)
return false; return false;
@ -166,7 +136,7 @@ public class Post {
*/ */
@Override @Override
public String toString() { public String toString() {
return "Post [title=" + title + ", article=" + article + ", author=" + author + ", tags=" + tags + "]"; return "Post [title=" + title + ", author=" + author + ", tags=" + tags + "]";
} }
} }

View File

@ -135,7 +135,6 @@ public class TagRepository implements Closeable {
private static Post documentToPost(Document document) { private static Post documentToPost(Document document) {
Post post = new Post(); Post post = new Post();
post.setTitle(document.getString(DBCollection.ID_FIELD_NAME)); post.setTitle(document.getString(DBCollection.ID_FIELD_NAME));
post.setArticle(document.getString("article"));
post.setAuthor(document.getString("author")); post.setAuthor(document.getString("author"));
post.setTags((List<String>) document.get(TAGS_FIELD)); post.setTags((List<String>) document.get(TAGS_FIELD));
return post; return post;

View File

@ -19,6 +19,7 @@ import org.junit.Test;
public class TaggingIntegrationTest { public class TaggingIntegrationTest {
/** /**
* Object to test.
* Object to test. * Object to test.
*/ */
private TagRepository repository; private TagRepository repository;