• Tutorials
  • Courses
  • Tracks

Advanced Java Quiz Day 50

Last Updated :
Discuss
Comments

Question 1

Which of the following is true about ORM?


  • It maps Java objects to XML configuration only

  • It allows mapping Java objects to database tables

  • It is only used in NoSQL databases

  • It is used for converting JSON to Java Objects

Question 2

Which statement correctly describes JPA?

  • JPA is a framework that directly implements ORM functionality

  • JPA is a specification for ORM in Java

  • JPA is only compatible with Hibernate

  • JPA is a database vendor-specific API

Question 3

Hibernate can be described as:

  • A specification of ORM

  • An implementation of the JPA specification

  • A NoSQL database system

  • A Java Persistence Interface

Question 4

In the Hibernate lifecycle, which state means the object is not associated with any Hibernate Session and is just a normal Java object?


  • Persistent

  • Detached

  • Transient

  • Removed

Question 5

Which Hibernate lifecycle state means the object is associated with a Hibernate Session and changes are tracked automatically?

  • Persistent

  • Detached

  • Removed

  • Transient

Question 6

Which annotation is used to mark a class as a JPA entity?


  • @Id

  • @Entity

  • @Table

  • @Column

Question 7

Which annotation specifies the primary key of an entity?

  • @Entity

  • @Table

  • @Id

  • @Primary

Question 8

The @Table annotation in JPA is used for:

  • Mapping an entity to a specific database table

  • Defining the primary key column

  • Creating indexes in the database

  • Mapping entity fields to columns

Question 9

Which is NOT a valid Hibernate lifecycle state?

  • Transient

  • Persistent

  • Cached

  • Detached

There are 9 questions to complete.

Take a part in the ongoing discussion