Online Exam Quiz

questionQuestion  1 to 30

What is the main advantage of using Spring Data JPA?

  • High performance
  • Simplifies data access
  • Complex configuration
  • No support for transactions
Mark for review

What is Lazy Initialization in Hibernate?

  • Initializing a bean during Spring container startup
  • Deferring initialization of a bean until it's requested
  • Loading all beans at once
  • Initializing a bean after transaction completion
Mark for review

Which of these is used to create a Hibernate SessionFactory?

  • Configuration
  • Session
  • Transaction
  • Query
Mark for review

What is the default scope of a Spring bean?

  • Singleton
  • Prototype
  • Request
  • Session
Mark for review

What does the @Table annotation in Hibernate do?

  • Maps a class to a database table
  • Maps a method to a table operation
  • Maps a package to a table schema
  • Maps a variable to a table column
Mark for review

Which annotation is used for defining a method as a transaction in Spring?

  • @Transactional
  • @Transaction
  • @Transact
  • @TransactionManager
Mark for review

What is HQL in Hibernate?

  • Hibernate Query Language
  • Hibernate Quick Language
  • Hibernate Query Library
  • Hibernate Quick Library
Mark for review

Which of these is a feature of Spring Boot?

  • Requires extensive XML configuration
  • No embedded server support
  • Fast startup and development
  • Limited to monolithic applications
Mark for review

Which of the following is true about Spring Boot?

  • It is slower than traditional Spring applications
  • It requires XML configuration
  • It provides embedded server support
  • It does not support microservices
Mark for review

What is the role of @Configuration in Spring?

  • To define a Spring configuration class
  • To define a Spring component
  • To define a Spring bean
  • To define a Spring service
Mark for review

Which method is used to delete an object in Hibernate?

  • delete()
  • remove()
  • destroy()
  • drop()
Mark for review

What is Spring?

  • A framework for developing Java applications
  • A database management system
  • A programming language
  • An operating system
Mark for review

Which method is used to save an object in Hibernate?

  • persist()
  • save()
  • insert()
  • store()
Mark for review

What is the default transaction management type in Spring?

  • Programmatic
  • Declarative
  • Hybrid
  • Manual
Mark for review

Which method is used to begin a transaction in Hibernate?

  • begin()
  • start()
  • open()
  • beginTransaction()
Mark for review

Which is a correct statement about Spring Boot?

  • It is a replacement for Spring Framework
  • It simplifies the development of Spring applications
  • It does not support REST APIs
  • It is only used for web applications
Mark for review

Which of these is an advantage of using Spring?

  • High memory consumption
  • Loose coupling
  • Complexity
  • High latency
Mark for review

Which annotation is used to inject dependencies in Spring?

  • @Autowired
  • @Resource
  • @Inject
  • All of the above
Mark for review

What is the purpose of the Criteria API in Hibernate?

  • To perform SQL operations
  • To create database schemas
  • To retrieve entities based on specific criteria
  • To manage transactions
Mark for review

Which of these is not a feature of Hibernate?

  • Automatic table creation
  • Lazy loading
  • Caching
  • HTTP session management
Mark for review

What is the purpose of the @Entity annotation in Hibernate?

  • Defines a class as an entity
  • Maps a class to a database entity
  • Identifies a method as transactional
  • Specifies a primary key
Mark for review

What is the use of @JoinColumn annotation in Hibernate?

  • To specify the primary key column
  • To specify the foreign key column
  • To specify a unique constraint
  • To specify a composite key
Mark for review

What does the @Transactional annotation do in Spring?

  • Manages transactions automatically
  • Logs transaction details
  • Sends transaction alerts
  • None of the above
Mark for review

What does the Spring @Component annotation do?

  • Defines a class as a Spring component
  • Defines a method as a Spring component
  • Defines a variable as a Spring component
  • Defines a package as a Spring component
Mark for review

Which of these is not a valid scope in Spring?

  • Singleton
  • Prototype
  • Request
  • Immediate
Mark for review

Which interface is used for transaction management in Spring?

  • TransactionManager
  • PlatformTransactionManager
  • HibernateTransactionManager
  • JdbcTransactionManager
Mark for review

What is the purpose of the ORM module in Spring?

  • Managing database connections
  • Handling web requests
  • Integrating with Hibernate and JPA
  • Providing security features
Mark for review

Which of these is not a valid state of a Hibernate object?

  • Transient
  • Persistent
  • Detached
  • Null
Mark for review

What is Hibernate?

  • A Java library for graphics
  • A Java framework for object-relational mapping
  • A type of SQL database
  • A web server
Mark for review

Which annotation is used to define a Spring bean?

  • @Bean
  • @Autowired
  • @Component
  • @Service
Mark for review

blinkerOnline

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • Answered
  • Not Answered
  • Marked for Review