Add annotations

Report a typo

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 = ""
}
Match the items from left and right columns
1
2
3
JoinTable
JoinColumn
ManyToMany
___

Create a free account to access the full topic