Setting orphan handling

Report a typo

Complete the code so that it removes orphans correctly.

Java
@Entity
@Table(name = "books")
public class Books {
    @Id
    @Column(name = "book_id")
    private long bookId;

    @Column(name = "book_name")
    private String bookName;

    @OneToMany(cascade = CascadeType.REMOVE, __________)
    @JoinColumn(name = "order_id", nullable = false)
    private List<OrderEntity> orders = new ArrayList<>();

}
Kotlin
@Entity
@Table(name = "books")
data class Books(
    @Id
    @Column(name = "book_id")
    var bookId: Long = 0L,

    @Column(name = "book_name")
    var bookName: String = "",

    @OneToMany(cascade = [CascadeType.REMOVE], __________)
    @JoinColumn(name = "order_id", nullable = false)
    var orders: List<OrderEntity> = ArrayList()

)
Select one option from the list
___

Create a free account to access the full topic