Welcome to Set 10 of our 100+ Spring Boot MCQ Questions and Answers series. This Set 10 continues from MCQs 91-100 and covers Spring Boot and Spring framework modules.
Complete Spring Boot MCQ Questions and Answers series:
Spring Boot MCQ Questions and Answers | Set 1
Spring Boot MCQ Questions and Answers | Set 2
Spring Boot MCQ Questions and Answers | Set 3
Spring Boot MCQ Questions and Answers | Set 4
Spring Boot MCQ Questions and Answers | Set 5
Spring Boot MCQ Questions and Answers | Set 6
Spring Boot MCQ Questions and Answers | Set 7
Spring Boot MCQ Questions and Answers | Set 8
Spring Boot MCQ Questions and Answers | Set 9
Spring Boot MCQ Questions and Answers | Set 10
91. What is the role of the @Table annotation in a JPA entity?
Answer:
Explanation:
The @Table annotation in a JPA entity is used to specify the table in the database to which the entity should be mapped. It can include the table name, catalog, schema, and unique constraints.
92. Which Spring Boot starter is used for integrating Apache Cassandra?
Answer:
Explanation:
The spring-boot-starter-data-cassandra starter is used for integrating Apache Cassandra, a NoSQL database, into Spring Boot applications. It includes support for Cassandra operations and configurations.
93. What is the primary use of the @ManyToOne annotation in JPA?
Answer:
Explanation:
The @ManyToOne annotation in JPA is used to define a many-to-one relationship between two entities. It specifies that many entities are mapped to one target entity.
94. How can you define custom query methods in a Spring Data repository?
Answer:
Explanation:
Custom query methods in a Spring Data repository can be defined by declaring methods in the repository interface. Spring Data derives the query from the method name or uses the provided @Query annotation.
95. What is the use of @OneToOne annotation in JPA?
Answer:
Explanation:
The @OneToOne annotation in JPA is used to define a one-to-one relationship between two entities. It indicates that one entity is associated with another entity having a one-to-one relationship.
96. What is the primary use of the @OneToMany annotation in JPA?
Answer:
Explanation:
The @OneToMany annotation in JPA is used to define a one-to-many relationship between two entities. It specifies that one entity is associated with multiple instances of another entity.
97. What is the role of the @Version annotation in a JPA entity?
Answer:
Explanation:
The @Version annotation in a JPA entity is used to enable optimistic locking by marking a field as a version column. This field is used to ensure data integrity during concurrent updates.
98. How does Spring Boot simplify the integration with Apache Kafka?
Answer:
Explanation:
Spring Boot simplifies the integration with Apache Kafka by providing the spring-boot-starter-kafka dependency. It includes support for Kafka template and consumer/producer configurations.
99. What is the purpose of the @Lob annotation in a JPA entity?
Answer:
Explanation:
The @Lob annotation in a JPA entity is used to define a Large Object (LOB) field in the database, such as a BLOB (Binary Large Object) or CLOB (Character Large Object).
100. How does Spring Boot support reactive data access?
Answer:
Explanation:
Spring Boot supports reactive data access by using the R2DBC (Reactive Relational Database Connectivity) API. It provides non-blocking and reactive programming support for relational databases.
❮ Previous Set Go to Main Spring Boot MCQ Page❯
Comments
Post a Comment
Leave Comment