Loading

Quipoin Menu

Learn • Practice • Grow

spring / MyBatis Integration
mcq
Direction: Choose the correct option

Q1.

What is MyBatis?
A. A persistence framework that maps Java objects to SQL statements using XML or annotations
B. An ORM tool
C. A JDBC wrapper
D. None
Direction: Choose the correct option

Q2.

How does MyBatis differ from Hibernate?
A. MyBatis gives full control over SQL; Hibernate abstracts SQL
B. MyBatis is an ORM; Hibernate is not
C. They are same
D. None
Direction: Choose the correct option

Q3.

What is a mapper in MyBatis?
A. An interface that defines SQL operations
B. An XML file with SQL mappings
C. Both A and B
D. None
Direction: Choose the correct option

Q4.

How do you integrate MyBatis with Spring?
A. Using MyBatis-Spring adapter
B. Using SqlSessionFactoryBean
C. Using MapperFactoryBean
D. All of the above
Direction: Choose the correct option

Q5.

What is SqlSession in MyBatis?
A. The main Java interface for executing SQL commands
B. A session object
C. A connection
D. None
Direction: Choose the correct option

Q6.

What does @MapperScan do in MyBatis-Spring?
A. Scans for mapper interfaces and registers them as Spring beans
B. Creates mappers
C. Configures mappers
D. None
Direction: Choose the correct option

Q7.

How do you define a mapper method with annotation?
A. @Select, @Insert, @Update, @Delete
B. @Query
C. @SQL
D. @Mapper
Direction: Choose the correct option

Q8.

What is the purpose of @Results annotation?
A. To map database columns to Java properties
B. To define result sets
C. To specify joins
D. None
Direction: Choose the correct option

Q9.

How do you handle dynamic SQL in MyBatis?
A. Using <if>, <where>, <foreach> in XML
B. Using @SelectProvider with SQL builder class
C. Both A and B
D. None
Direction: Choose the correct option

Q10.

What is a SqlSessionFactory?
A. Factory to create SqlSession instances
B. A bean that holds configuration
C. Both A and B
D. None