Key Features of Jimmer ORM
mainJimmer provides a comprehensive suite of features for JVM developers (Java & Kotlin):
Querying Capabilities
- Flexible APIs: Provides a robust Java DSL and an elegant Kotlin DSL.
- Advanced SQL Support: Supports Derived Tables, CTE (Common Table Expressions), and Recursive-CTE. You can mix native SQL expressions into the DSL to use database-specific features.
- SQL Optimization: Automatically removes unused table joins, merges logically equivalent joins, and merges logically equivalent implicit subqueries. It also optimizes
countqueries for pagination.
DTO Management
Jimmer uses a compile-time code generator to make DTOs extremely efficient. It supports three main types:
- Output DTO: Used for the return values of complex queries.
- Input DTO: Used as parameters for complex save operations.
- Specification DTO: Used as parameters for complex queries.
Graph Operations
- Reading: Supports querying any graph structure without the
N + 1problem. Objects at any level can be partial, and self-referential properties can be queried recursively. - Writing: Supports saving any graph structure using database
upsert(merge) capabilities. Multiple objects at any level are handled via batch DML operations. It also automatically translates constraint violation exceptions.
Performance and Caching
- Multi-level Caching: Supports multiple cache levels where each level can use different technologies. It caches not just objects, but also associations, computed values, and multiple views.
- Consistency: Automatically maintains cache consistency.
Integration
- Fast support for GraphQL.
- Client contract generation based on doc comments (OpenAPI, TypeScript).