Home / CSE MCQs / JPA :: Discussion

Discussion :: JPA

  1. What's true about the following @Entity association between House and Window?
    @Entity
    public class Window {
    @Id
    private int winNo;
    @ManyToOne
    private House aHouse;
    }
    @Entity
    public class House {
    @Id
    private int houseNo;
    @OneToMany(mappedBy="aHouse")
    private List windows;
    }
  2. A.
    It's OneToMany unidirectional association
    B.
    It's OneToMany bidirectional association
    C.
    The association owner is the House class
    D.
    The association owner is the Window class

    View Answer

    Workspace

    Answer : Option B

    Explanation :



Be The First To Comment