diff --git a/persistence-modules/java-mongodb/src/main/java/com/baeldung/tagging/Post.java b/persistence-modules/java-mongodb/src/main/java/com/baeldung/tagging/Post.java index 739a7e6300..269a8adc19 100644 --- a/persistence-modules/java-mongodb/src/main/java/com/baeldung/tagging/Post.java +++ b/persistence-modules/java-mongodb/src/main/java/com/baeldung/tagging/Post.java @@ -15,11 +15,6 @@ public class Post { */ private String title; - /** - * Full article. - */ - private String article; - /** * Author of the post. */ @@ -49,25 +44,6 @@ public class Post { 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}. * @@ -115,7 +91,6 @@ public class Post { public int hashCode() { final int prime = 31; int result = 1; - result = prime * result + ((article == null) ? 0 : article.hashCode()); result = prime * result + ((author == null) ? 0 : author.hashCode()); result = prime * result + ((tags == null) ? 0 : tags.hashCode()); result = prime * result + ((title == null) ? 0 : title.hashCode()); @@ -136,11 +111,6 @@ public class Post { if (getClass() != obj.getClass()) return false; 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 (other.author != null) return false; @@ -166,7 +136,7 @@ public class Post { */ @Override public String toString() { - return "Post [title=" + title + ", article=" + article + ", author=" + author + ", tags=" + tags + "]"; + return "Post [title=" + title + ", author=" + author + ", tags=" + tags + "]"; } } diff --git a/persistence-modules/java-mongodb/src/main/java/com/baeldung/tagging/TagRepository.java b/persistence-modules/java-mongodb/src/main/java/com/baeldung/tagging/TagRepository.java index cb65e05f99..d27d48c743 100644 --- a/persistence-modules/java-mongodb/src/main/java/com/baeldung/tagging/TagRepository.java +++ b/persistence-modules/java-mongodb/src/main/java/com/baeldung/tagging/TagRepository.java @@ -135,7 +135,6 @@ public class TagRepository implements Closeable { private static Post documentToPost(Document document) { Post post = new Post(); post.setTitle(document.getString(DBCollection.ID_FIELD_NAME)); - post.setArticle(document.getString("article")); post.setAuthor(document.getString("author")); post.setTags((List) document.get(TAGS_FIELD)); return post; diff --git a/persistence-modules/java-mongodb/src/test/java/com/baeldung/tagging/TaggingIntegrationTest.java b/persistence-modules/java-mongodb/src/test/java/com/baeldung/tagging/TaggingIntegrationTest.java index 2796bc60fb..ffb945e6d4 100644 --- a/persistence-modules/java-mongodb/src/test/java/com/baeldung/tagging/TaggingIntegrationTest.java +++ b/persistence-modules/java-mongodb/src/test/java/com/baeldung/tagging/TaggingIntegrationTest.java @@ -19,6 +19,7 @@ import org.junit.Test; public class TaggingIntegrationTest { /** + * Object to test. * Object to test. */ private TagRepository repository;