Complete @JoinTable

Report a typo

There is a many-to-many relationship based on the following tables:

book to author many-to-many relationship via book_author table

The Book and Author classes are represented below:

Java
@Entity
public class Book {

    @Id
    private long id;
    private String name;
    private String genre;

    @ManyToMany
    @JoinTable(
            name = "________", //1
            joinColumns = @JoinColumn(name = "________"), //2
            inverseJoinColumns = @JoinColumn(name = "________")) //3
    private Set<Author> authors = new HashSet<>();
}

@Entity
public class Author {

    @Id
    private long id;
    private String name;
    private String email;

    @ManyToMany(mappedBy = "________") //4
    private Set<Book> books = new HashSet<>();
}
Kotlin
@Entity
class Book {
    @Id
    var id: Long = 0
    var name: String = ""
    var genre: String = ""

    @ManyToMany
    @JoinTable(
        name = "________", //1
        joinColumns = [JoinColumn(name = "________")], //2
        inverseJoinColumns = [JoinColumn(name = "________")] //3
    ) 
    private val authors: Set<Author> = HashSet()
}


@Entity
class Author {
    @Id
    var id: Long = 0
    var name: String = ""
    var email: String = ""

    @ManyToMany(mappedBy = "________") //4
    var books: MutableSet<Book> = HashSet()
}

Fill in the blanks with the appropriate values.

Match the items from left and right columns
1
2
3
4
book_id
author_id
book_author
authors
___

Create a free account to access the full topic