Show List

Quiz - JPA and Hibernate - 2

54%

Public Average Score
Select the right answer for below questions:

What is the @ManyToOne annotation used for in JPA?
To define a one-to-many relationship between two Entities
To define a one-to-one relationship between two Entities
To define a many-to-many relationship between two Entities
To define a relationship between a database table and a user interface component
To define a many-to-many relationship between two Entities

What is the main difference between the First-Level Cache and the Second-Level Cache in Hibernate?
The First-Level Cache is shared across multiple Sessions, while the Second-Level Cache is associated with a single Session
The First-Level Cache is stored in memory, while the Second-Level Cache is stored on disk
The First-Level Cache is stored on disk, while the Second-Level Cache is stored in memory
The First-Level Cache is associated with a single Session, while the Second-Level Cache is shared across multiple Sessions
The First-Level Cache is associated with a single Session, while the Second-Level Cache is shared across multiple Sessions

What is the Hibernate Query Language (HQL) used for in Hibernate?
To write database queries in a low-level, SQL-like syntax
To write database queries in a high-level, XML-based syntax
To write database queries in a high-level, object-oriented syntax
To write database queries in a low-level, Java-based syntax
To write database queries in a high-level, object-oriented syntax

What is the main advantage of using HQL over SQL in Hibernate?
HQL is more powerful than SQL
HQL is easier to use than SQL
HQL is more flexible than SQL
HQL is faster than SQL
HQL is easier to use than SQL

What is the main difference between Hibernate and other ORM frameworks such as TopLink and iBatis?
Hibernate is more powerful than TopLink and iBatis
Hibernate is easier to use than TopLink and iBatis
Hibernate is more flexible than TopLink and iBatis
All of the above
All of the above

What is the main advantage of using JPA over Hibernate directly?
JPA is more powerful than Hibernate
JPA is easier to use than Hibernate
JPA is more flexible than Hibernate
JPA is faster than Hibernate
JPA is more flexible than Hibernate

What is the main purpose of JPA EntityManager?
To manage the lifecycle of entities in a JPA application
To manage the connection to the database in a JPA application
To manage the transactions in a JPA application
All of the above
To manage the lifecycle of entities in a JPA application

What is the main difference between the @OneToOne and @ManyToOne annotations in JPA?
The @OneToOne annotation is used for many-to-one relationships, while the @ManyToOne annotation is used for one-to-one relationships
The @OneToOne and @ManyToOne annotations are interchangeable and can be used for either one-to-one or many-to-one relationships
The @OneToOne annotation is used for one-to-one relationships, while the @ManyToOne annotation is used for many-to-one relationships
None of the above
The @OneToOne annotation is used for one-to-one relationships, while the @ManyToOne annotation is used for many-to-one relationships

What is the main difference between the @OneToMany and @ManyToMany annotations in JPA?
The @OneToMany annotation is used for one-to-many relationships, while the @ManyToMany annotation is used for many-to-many relationships
The @OneToMany annotation is used for many-to-many relationships, while the @ManyToMany annotation is used for one-to-many relationships
The @OneToMany and @ManyToMany annotations are interchangeable and can be used for either one-to-many or many-to-many relationships
None of the above
The @OneToMany annotation is used for one-to-many relationships, while the @ManyToMany annotation is used for many-to-many relationships

What is the main difference between the JPA EntityManager and Hibernate Session APIs?
The JPA EntityManager is more powerful than the Hibernate Session API
The JPA EntityManager is easier to use than the Hibernate Session API
The JPA EntityManager is a standard API, while the Hibernate Session API is specific to Hibernate
All of the above
The JPA EntityManager is a standard API, while the Hibernate Session API is specific to Hibernate

Submit
Retry
{"qz1-790462":"To define a many-to-many relationship between two Entities","qz1-790463":"The First-Level Cache is associated with a single Session, while the Second-Level Cache is shared across multiple Sessions","qz1-790464":"To write database queries in a high-level, object-oriented syntax","qz1-790465":"HQL is easier to use than SQL","qz1-790466":"All of the above","qz1-790467":"JPA is more flexible than Hibernate","qz1-790468":"To manage the lifecycle of entities in a JPA application","qz1-790469":"The @OneToOne annotation is used for one-to-one relationships, while the @ManyToOne annotation is used for many-to-one relationships","qz1-790470":"The @OneToMany annotation is used for one-to-many relationships, while the @ManyToMany annotation is used for many-to-many relationships","qz1-790471":"The JPA EntityManager is a standard API, while the Hibernate Session API is specific to Hibernate"}

    Leave a Comment


  • captcha text