Show List

Quiz - JPA and Hibernate - 1

52%

Public Average Score
Select the right answer for below questions:

What is JPA in Java?
Java Permanent Accessibility
Java Programming Accessibility
Java Processing Association
Java Persistence API
Java Persistence API

What is the main purpose of JPA?
To provide a standard way to build user interfaces
To provide a standard way to build web services
To provide a standard interface for accessing databases
To provide a standard way to manage security
To provide a standard interface for accessing databases

What is Hibernate in Java?
A framework for building user interfaces
A framework for building web services
A framework for managing security
A framework for accessing databases
A framework for accessing databases

What is the main advantage of using Hibernate over JDBC?
Hibernate provides a higher-level abstraction for accessing databases
Hibernate is faster than JDBC
Hibernate is easier to use than JDBC
All of the above
All of the above

What is the main difference between JPA and Hibernate?
JPA is a specification, while Hibernate is an implementation of the JPA specification
JPA is a framework, while Hibernate is a library
JPA is used for accessing databases, while Hibernate is used for building user interfaces
JPA is used for building web services, while Hibernate is used for managing security
JPA is a specification, while Hibernate is an implementation of the JPA specification

What is an Entity in JPA?
A Java class that represents a user interface component
A Java class that represents a web service
A Java class that represents a database table
A Java class that represents a security component
A Java class that represents a database table

What is the @Entity annotation used for in JPA?
To mark a Java method as a web service
To mark a Java class as an Entity
To mark a Java class as a user interface component
To mark a Java class as a security component
To mark a Java class as an Entity

What is an EntityManager in JPA?
An object used to manage user interface components
An object used to manage web services
An object used to manage security components
An object used to manage Entities
An object used to manage Entities

What is the @Id annotation used for in JPA?
To mark a field as the primary key of an Entity
To mark a field as a foreign key in a database table
To mark a field as a user interface component
To mark a field as a web service
To mark a field as the primary key of an Entity

What is the @OneToMany 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 one-to-many relationship between two Entities

Submit
Retry
{"qz1-707433":"Java Persistence API","qz1-707434":"To provide a standard interface for accessing databases","qz1-707435":"A framework for accessing databases","qz1-707436":"All of the above","qz1-707437":"JPA is a specification, while Hibernate is an implementation of the JPA specification","qz1-707438":"A Java class that represents a database table","qz1-707439":"To mark a Java class as an Entity","qz1-707440":"An object used to manage Entities","qz1-707441":"To mark a field as the primary key of an Entity","qz1-707442":"To define a one-to-many relationship between two Entities"}

    Leave a Comment


  • captcha text