Our experts have gathered these Hibernate MCQs through research, and we hope that you will be able to see how much knowledge base you have for the subject of Hibernate by answering these 100+ multiple-choice questions.
Get started now by scrolling down!
A. Jeremy Does Backflips Consistently
B. Java Does Best Connection
C. Java DataBase Connection
D. Just Do Both Carefully
A. A single-threaded, short-lived object representing a conversation between the application and the persistent store
B. Short-lived, single threaded objects containing persistent state and business function
C. Instances of persistent classes that are not currently associated with a org.hibernate.Session
D. A thread-safe, immutable cache of compiled mappings for a single database
A. The identifier property (if it exists) is null
B. All of these
C. You supply an unsaved-value in the mapping document for the class, and the value of the identifier property matches
D. The version property (if it exists) is null
A. The first level caching is provided by the EntityManager
B. The first level caching is limited to a particular user or request
C. Hibernate provides 2 levels of caching
D. All of these
A. <hibernate-hibernate>
B. <hibernate-java-java>
C. <hibernate-mapping>
D. <hibernate-tabular>
A. modular
B. open
C. ORM
D. OS
A. Session.Cloak()
B. Session.Close();
C. Session.Close
D. Session.Cloak
A. The API mismatch
B. The structural mismatch
C. The duplication mismatch
D. All
A. MXL
B. LMX
C. XXML
D. XML
A. A variable
B. The Declare statement
C. xpath mapping file
D. XML mapping file
A. client
B. tough
C. javascript
D. Object-Oriented
A. object redundant marker
B. object real maker
C. object relational marker
D. object relational mapping
A. zip it up
B. backflip
C. rollback
D. fallback
A. stores
B. tabs
C. non-persists
D. grows
A. vbscript
B. javascript
C. SQL
D. perl
A. delayed
B. self-orienting
C. thread safe
D. lousy
A. Hibernate Search works well in clustered mode
B. Hibernate Search provides synchronous and asynchronous index updates
C. Hibernate Search works well in non-clustered mode
D. All
A. Specifying queries that refer to classes and properties of classes
B. Performing basic CRUD operations on objects of persistent classes
C. All of these
D. Specifying mapping metadata
A. rational database
B. revised database
C. relational database
D. redundant database
A. HQL
B. C#
C. .Net
D. Java
A. xpath
B. XML
C. PL-SQL
D. XSLY
A. Plain Ole Java Object
B. Plain Old Java Object
C. Plaine Ole Java Object
D. Plaine Old Java Object
A. tabular
B. delimited
C. reformatted
D. delayed
A. sproc
B. UDF
C. transaction
D. table
A. browser
B. javascript
C. JAR
D. XML
A. Its is used to specify the table to persist the data
B. It is used to mark this class as an Entity bean
C. It is used to specify the identifier property of the entity bean
D. It is used to specify the primary key generation strategy
A. Variable
B. OOP
C. SQL
D. Integer
A. SessionFactory
B. Rational Database
C. ArrayList
D. VariableRepository
A. add @Fetch annotation and specify a FetchMode of JOIN
B. add @Fetch annotation and specify a FetchMode of SUBSELECT
C. use LEFT JOIN FETH clause on the HQL
D. All of these
A. <HTML>
B. <JAVA>
C. <property>
D. <XML>
A. Facilitates auditing of Hibernate mappings, which extend JPA, like custom types and collections/maps of "simple" types (Strings, Integers, etc.)
B. Facilitates auditing of all mappings defined by the JPA specification
C. Facilitates querying historical data
D. All
A. Both database connection and class mapping setup
B. Class mapping setup but NOT database connection
C. Database connection but NOT class mapping setup
D. SessionFactory but NEITHER database connection NOR class mapping setup
A. dialect
B. session
C. transaction
D. driver_class
A. transactionManager
B. hibernate-configuration
C. sessionFactory
D. cache.provider_class
A. Session-scoped
B. Session-scoped but NOT SessionFactory-scoped
C. Both Session-scoped and SessionFactory-scoped
D. SessionFactory-scoped
A. All
B. javax.persistence.metamodel.Metamodel acts as a repository of metamodel objects and provides access to them
C. Handle to javax.persistence.metamodel.Metamodel can be obtained from either the javax.persistence.EntityManagerFactory or the javax.persistence.EntityManagervia their getMetamodel method
D. The metamodel is a set of objects that describe a domain model
A. An instance will be detached after it gets retrieved from the database by the execution of query.
B. Changes made to the detached instance are still guaranteed to synchronize with the database.
C. A persistent instance will become detached after the session is closed.
D. Hibernate does NOT allow you to re-associate detached instances with a new persistence manager.
A. You can use SessionFactory to create Session instance
B. SessionFactory is not lightweight and is expensive to create
C. One SessionFactory can manage more than one database
D. The SessionFactory caches generated SQL statements and other mapping meta data that Hibernate uses at runtime
A. <property>
B. <session-factory>
C. <mapping>
D. <hibernate-configuration>
A. Transaction
B. Session
C. TransactionFactory
D. ConnectionProvider
A. validate
B. truncate
C. create
D. update
A. Detached instants can be made persistent by calling saveOrUpdate()
B. Transient instants can be made persistent by calling delete()
C. Transient instants are previously persistent and associated with an unique session
D. Persistent instants can be made transient by calling update()
A. You can use asc and desc to specify ascending and descending order
B. You cannot order query results by more than one properties
C. The default ordering is ascending
D. HQL provides an ORDER BY clause for ordering query result
A. The named query must be HQL strings. Native SQL is not supported in named query
B. The getNamedQuery() method obtains a query instance of named query
C. Named queries are precompiled when session factory is created
D. Named queries allow externalizing query strings to the mapping metadata
A. First Level Cache
B. Application layer level cache
C. Transaction layer level cache
D. SQL cache
A. ORM
B. JDBC
C. JMS
D. JPA
A. Multiple instances of SessionFactory are created, usually on application startup, from a Configuration instance
B. A Session is an inexpensive, non-threadsafe object that should be used once and then discarded for: a single request, a conversation or a single unit of work
C. In order to reduce lock contention in the database, a database transaction has to be as short as possible
D. A SessionFactory is an expensive-to-create, threadsafe object, intended to be shared by all application threads
A. The @Table annotation can be used to specify mapping database schema name
B. The @Column annotations is used to specify the column name of the foreign key
C. The @Entity annotation indicates that the class is mapped to a table in database
D. The @Id annotation indicates the field is the primary key for the entity
A. Configuration
B. Transaction
C. Session
D. SessionFactory
A. If the query returns more than result for the uniqueResult() method, the first one will be returned.
B. Both the createQuery() and createSQLQuery() method of Session interface can return a Query instance
C. You can paging the query result by using setFirstResult() and setMaxResult() method
D. You can use method chaining (methods return receiving object instead of void) with Query interface