Fill in the blanks in the code below with the appropriate annotations.
Java
@Getter @Setter
@Entity
public class Customer {
@Id
private long id;
private String name;
@________(cascade = {CascadeType.PERSIST, CascadeType.MERGE}) //1
@________( //2
name = "customer_product",
joinColumns = @________(name = "customer_id")) //3
private Set<Product> products = new HashSet<>();
}
@Getter @Setter
@Entity
public class Product {
@Id
private long id;
private String name;
}
Kotlin
@Entity
class Customer {
@Id
var id: Long = 0
var name: String = ""
@________(cascade = [CascadeType.PERSIST, CascadeType.MERGE]) //1
@________( //2
name = "customer_product",
joinColumns = ________(name = "customer_id")) //3
var products: MutableSet<Product> = HashSet()
}
@Entity
class Product {
@Id
var id: Long = 0
var name: String = ""
}