Hibernation Mcqs
Q.1: Which of the following is NOT true about Hibernate Template?<
A. Since it decouples the application from the spring framework, it is recommended that HibernateTemplate is always used for integration
B. They perform common setup routines for you, let you skip the boilerplate and concentrate on the logic you wantn
C. All Hibernate Template features can be achieved in an aspect-oriented way using Spring&#039;s Declarative Transaction Management
D. It automatically open and close sessions and commit or rollback transactions after the code executione
Q.2: Which of the following is not a Session method?/
A. Session.saveorupdate()
B. Session.remove()
C. Session.save()
D. Session.persist()
Q.3: Which one of the following statements is true about the following HQL query: select p.number from employee e join e.phones p|
A. This query is using outer join so it&#039;ll return all the Phone entity instances no matter it is associated with an Employee or not.
B. This query is missing the joining condition so it won&#039;t workA
C. The query indicates that the &#34;number&#34; is the name of one of the columns of the Phone tableb
D. Because the &#34;phones&#34; is a collection association field, the path navigation couldn&#039;t continuej
Q.4: Which of the following is NOT true about sharding in Hibernate (Hibernate Shards)?R
A. The primary goal of Hibernate Shards is to enable application developers to query and transact against sharded datasets using the standard Hibernate Core API
B. Hibernate Shards can be conceptually divided into Generalized sharding logic, Application specific sharding logic and Hibernate Default sharding
C. Hibernate Shards primarily consists of shard-aware implementations of many of the Hibernate Core interfacesk
D. Hibernate Shards can be conceptually divided into Generalized sharding logic and Application specific sharding logict
Q.5: Which of the following is NOT true about SessionFactory?8
A. Its a Singleton class
B. Its initialization process is expensive as it loads all configurations including database setting, OR settingsn
C. It helps in customized extraction of data.*
D. Configures HIBERNATE with HIBERNATE configuration file for use in applicationM
Q.6: Which one of the following statement is NOT true about single table inheritance strategy?Z
A. The single table strategy uses one table to contain all the possible state of a hierarchyY
B. Single table strategy will be more wasteful of database space.>
C. There shouldn&#039;t be any columns left unfilled in the single table strategyN
D. The single table strategy is the most performance way in polymorphic queries and write operations.b
Q.7: Which of the following statements is True about one to one relationship mapping?P
A. mappedBy element should be specified in the @OneToOne annotation in the entity that defines a join columni
B. One to one mapping can only be unidirectional-
C. The @JoinColumn annotation goes on the mapping of the entity that is mapped to the table containing the foreign keys
D. One to one mapping can only be bidirectional,
Q.8: Which one of the following statements is true about joining associations in Hibernate?V
A. In HQL the LEFT keyword in LEFT JOIN FETCH is optional6
B. When using HQL join queries you have to explicitly specify the join condition using either WHERE or ON clausem
C. HQL provides a fetch join in the FROM clause to lazy load the associated objectsP
D. When using outer joins, Hibernate will always return a list containing distinct items.V
Q.9: Which of the following statements is NOT true about persistent instance?H
A. Any change made on the persistent object will be synchronized with the database after the transaction ends.k
B. Before session get closed, an object will becomes persistent after it get saved by the persistence manager&#039;s save() method.
C. A persistent instance has a primary key set as its database identifierF
D. An object is not persistent if it&#039;s retrieved from the database by the execution of query._
Q.10: If you want to save your modifications at any time without knowing about the state of an session, then which of the following operations will you use:
A. Neither Merge nor Update
B. Merge
C. Update
D. Both Merge and Update

Related Mcqs

All Subject Mcqs