Hibernate / MyBatis Interview questions
What are the key features of MyBatis?
MyBatis combines a focused set of capabilities aimed specifically at making hand-written SQL easier to work with from Java, without taking over SQL generation the way a full ORM does.
| Feature | What it Provides |
| SQL mapping | Maps hand-written SQL statements directly to Java interface methods |
| Dynamic SQL | XML tags for conditionally building SQL based on parameter values |
| Result mapping | Flexible mapping of result sets to simple objects, nested objects, or collections |
| Mapper proxies | Auto-generated implementations of mapper interfaces, no manual DAO coding |
| Caching | Built-in first-level (session) and optional second-level (mapper) caching |
| Spring integration | First-class support via MyBatis-Spring and MyBatis-Spring-Boot-Starter |
Together these features are what let a MyBatis-based data access layer stay close to raw SQL — valuable for complex or performance-sensitive queries — while still avoiding the tedious plumbing that made raw JDBC code repetitive and error-prone to write and maintain by hand.
More Related questions...