Home / CSE MCQs / JPA ::

CSE MCQs :: JPA

  1. What are the JPA @Entity association attributes?
  2. A.
    Association validation
    B.
    Association multiplicity
    C.
    Association cascade behavior
    D.
    Association direction

    View Answer

    Workspace

    Discuss Discuss in Forum


  3. JPA implementation is provided by ---?
  4. A.
    Hibernate
    B.
    Toplink
    C.
    Ibatis
    D.
    All of them

    View Answer

    Workspace

    Discuss Discuss in Forum


  5. ________ has stated that ideas came from several frameworks, including Hibernate and JDO.
  6. A.
    Sun Microsystems
    B.
    Java (software platform)
    C.
    Open JDK
    D.
    Java (programming language)

    View Answer

    Workspace

    Discuss Discuss in Forum


  7. What is the Life Cycle Of A Jpa Entity?
  8. A.
    New / Transient
    B.
    Managed / Persisted
    C.
    Detached
    D.
    All of the above

    View Answer

    Workspace

    Discuss Discuss in Forum


  9. 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;
    }
  10. 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

    Discuss Discuss in Forum


  11. Which annotation is used to create Pk-Fk relation b/w two tables?
  12. A.
    JoinColumn
    B.
    ForeignKey
    C.
    JoinedKey
    D.
    None of these

    View Answer

    Workspace

    Discuss Discuss in Forum


  13. Object/relational metadata can be specified directly in the entity class file by using annotations, or in a separate ________ descriptor file distributed with the application.
  14. A.
    Scalable Vector Graphics
    B.
    HTML
    C.
    XML
    D.
    XHTML

    View Answer

    Workspace

    Discuss Discuss in Forum


  15. What is TRUE about the cascading and cascade mode attributes in Entity Beans?
  16. A.
    Cascade mode attributes can be specified for the association annotaions (like @OneToMany) in an entity bean
    B.
    The cascading direction is from the target entity to the source entity
    C.
    PERSIST, DELETE and REFRESH are cascading mode attributes
    D.
    Refresh cascade causes to refresh the target entities of a relationship when refresh is invoked on the source entity of the relationship

    View Answer

    Workspace

    Discuss Discuss in Forum


  17. Which attribute of @OneToMany is used to mark an entity as owned?
  18. A.
    cascade
    B.
    mappedBy
    C.
    propertyRef
    D.
    None

    View Answer

    Workspace

    Discuss Discuss in Forum


  19. What is the JPA equivalent of hibernate.cfg.xml file?
  20. A.
    configuration.xml
    B.
    persistence.xml
    C.
    jpa.configuration.xml
    D.
    None

    View Answer

    Workspace

    Discuss Discuss in Forum