Skip to content

Commit 76bcb6c

Browse files
committed
Deleting getter getAuthor
Signed-off-by: Kemal Žigović <kvant800@gmail.com>
1 parent 1938c89 commit 76bcb6c

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

src/main/java/com/kvark900/api/model/Author.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class Author {
2323

2424
// @NotNull
2525
@JsonIgnore
26-
@ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE}, mappedBy = "authors")
26+
@ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE}, targetEntity = Book.class, mappedBy = "authors")
2727
private Set<Book> books = new HashSet<>();
2828

2929

src/main/java/com/kvark900/api/model/Book.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ public class Book {
1919
@ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE}, targetEntity = Author.class)
2020
@JoinTable(name = "book_author",
2121
joinColumns = @JoinColumn(name = "book_id"),
22-
inverseJoinColumns = @JoinColumn(name = "author_id")
23-
)
22+
inverseJoinColumns = @JoinColumn(name = "author_id"))
2423
private Set<Author> authors = new HashSet<>();
2524

2625
private String yearOfPublication;
@@ -32,8 +31,7 @@ public class Book {
3231
@ManyToMany(cascade = CascadeType.PERSIST, targetEntity = Topic.class)
3332
@JoinTable(name = "book_topic",
3433
joinColumns = @JoinColumn(name = "book_id"),
35-
inverseJoinColumns = @JoinColumn(name = "topic_id")
36-
)
34+
inverseJoinColumns = @JoinColumn(name = "topic_id"))
3735
private Set<Topic> topics = new HashSet<>();
3836

3937
//Constructors
@@ -69,9 +67,6 @@ public String getTitle() {
6967
public void setTitle(String title) {
7068
this.title = title;
7169
}
72-
public Set<Author> getAuthor() {
73-
return authors;
74-
}
7570
public String getYearOfPublication() {
7671
return yearOfPublication;
7772
}

0 commit comments

Comments
 (0)