Q.1
Spring HibernateTemplate can simplify your DAO implementation by managing sessions and transactions for you.
  • a) True
  • b) False
Q.2
An alternative to Spring HibernateTemplate is:-
  • a) HibernateContext
  • b) Hibernate contextual sessions
  • c) All of the mentioned
  • d) None of the mentioned
Q.3
Sessionfactory can manage contextual sessions for you and allows you to retrieve them by the:-
  • a) getSession() method
  • b) getCurrent() method
  • c) getCurrentSession() method
  • d) none of the mentioned
Q.4
DAO methods require access to the session factory, which can be injected:-
  • a) a setter method
  • b) constructor argument
  • c) none of the mentioned
  • d) all of the mentioned
Q.5
DAO methods must be made transactional.
  • a) True
  • b) False
Q.6
Annotation to find a transaction and then fail, complaining that no Hibernate session been bound to the thread.
  • a) @Transaction
  • b) @Transactional
  • c) @Transactions
  • d) None of the mentioned
Q.7
In the bean configuration file for Hibernate (i.e., beans-hibernate.xml), you have to declare a HibernateTransactionManager instance for this application and enable declarative transaction via:-
  • a) tx:annotation
  • b) tx:annotationdriven
  • c) tx:annotation-driven
  • d) none of the mentioned
Q.8
HibernateTemplate will translate the native Hibernate exceptions into exceptions in Spring DataAccessException hierarchy.
  • a) True
  • b) False
Q.9
Annotation for Hibernate exceptions to be translated into Spring DataAccessException for consistent exception handling:-
  • a) @Translation
  • b) @Repo
  • c) @Repository
  • d) None of the mentioned
Q.10
Instance to translate the native Hibernate exceptions into data access exceptions in Spring DataAccessException hierarchy.
  • a) PersistenceExceptionPostProcessor
  • b) PersistenceExceptionTranslation
  • c) PersistenceException
  • d) PersistenceExceptionTranslationPostProcessor
Q.11
You can assign a component name in this annotation and have the session factory autowired by the Spring IoC container with @Autowired.
  • a) True
  • b) False
Q.12
Spring provides to simplify your DAO implementation by managing entitymanagers and transactions for you:-
  • a) HibernateTemplate
  • b) JpaTemplate
  • c) SpringTemplate
  • d) None of the mentioned
Q.13
Annotation used for entity manager injection in EJB components.
  • a) @PersistenceContext
  • b) @Persistence
  • c) @PersistenceCon
  • d) None of the mentioned
Q.14
To use the context injection approach, you can declare an entity manager field in your DAO and annotate it with the @PersistenceContext annotation.
  • a) True
  • b) False
Q.15
JpaTemplate will translate the native JPA exceptions into exceptions in Spring DataAccessException hierarchy.
  • a) True
  • b) False
0 h : 0 m : 1 s