Key Features ✦
To help readers better understand the key features, let's first introduce Jimmer's fundamental design philosophy
Design Philosophy
The core concept of Jimmer is to read and write data structures of arbitrary shapes as a whole, rather than simply processing entity objects.
-
Jimmer entity objects are not POJOs, and can easily
. -
Data structures of any shape can be processed as a whole for:
- Reading: Jimmer creates this infinitely flexible data structure and passes it to you
- Writing: You create this infinitely flexible data structure and pass it to Jimmer
Since Jimmer's design philosophy is to read and write data structures of arbitrary shapes rather than processing simple objects, how does it differ from technologies with similar capabilities?
Here is the English translation of the provided table:
Comparison | Description |
---|---|
GraphQL | GraphQL only focuses on querying data structures of arbitrary shapes; Jimmer not only does this but also focuses on how to write data structures of arbitrary shapes |
GraphQL does not support recursive queries based on self-referencing properties, Jimmer does | |
JPA | In JPA, to control the shape of the data structure being saved, properties must be configured with insertable, updatable, or cascade (for associated properties). Regardless of the configuration, the saved data structure is fixed; Jimmer entities are not POJOs, their data structure shapes are ever-changing, no prior planning and design is needed, any business scenario can construct the data structure it needs and save it directly |
For queries, JPA's | |
In JPA, if you need to use a DTO object to query only part of the properties, the DTO must be a simple object without any associations. That is, it loses the most valuable capability of ORM, degrading from | |
In JPA, updating an object results in all updatable columns being modified. For simplicity, developers rarely use | |
JPA's | |
MongoDB | In MongoDB, each document structure is a data island. Although MongoDB's data structure is weakly typed, from a business perspective, which data islands exist and the internal hierarchical structure of each data island need to be designed and agreed upon in advance. Once the design and agreement are completed, the format of the entire data view is fixed and must be processed from a fixed perspective; In Jimmer, the shape of the data structure does not need to be designed in advance, any business scenario can freely plan a data structure format, and read and write the corresponding data structure as a whole. |
Based on this core concept, Jimmer will bring you convenience that was previously unattainable in any technology stack, freeing you from dealing with tedious details and allowing you to focus on quickly implementing complex business logic.
Key features
Based on the aforementioned core concept, Jimmer provides the following features:
- Convenient query API, robust Java DSL, elegant Kotlin DSL
- Dynamic querying is designed for multi-table queries
- DSL supports mixing native SQL expressions to use non-standard database-specific capabilities
- Extends SQL capabilities, easily supporting advanced features that are costly to implement with native SQL
- Advanced SQL optimization capabilities
- Automatic removal of unnecessary table joins
- Automatic merging of logically equivalent table joins
- Automatic merging of logically equivalent implicit subqueries
- Paginated query can automatically generate and optimize count query
- DTO language and corresponding compile-time code generator, making DTOs extremely cost-effective
- Output DTO, used as return for complex queries
- Input DTO, used as parameter for complex saves
- Specification DTO, used as parameter for complex queries
- The DTO supported by the ORM itself can be seamlessly integrated without introducing additional logic into business code
- Query arbitrary graph structures
- No "N + 1" problem
- Objects at any level can be incomplete
- Can recursively query self-referencing properties
- Can return either entities directly or output DTOs
- Save arbitrary graph structures
- Merge data using the database's native upsert capabilities
- Multiple objects at each level are handled using batch DML operations
- Automatically translates constraint violation exceptions
- Saved objects at any level can be incomplete
- Can save either entities directly or input DTOs
This section has undergone a major upgrade, and the documentation is actively being restructured. Please refer to the save-command examples in the accompanying examples.
- Powerful caching
- Multi-layer caching, technology for each cache layer can be freely chosen
- Not just object caching (associations, computed values, multiple views)
- Automatically maintains cache consistency
- Rapid support for GraphQL
- Client contracts based on document comments (OpenAPI, TypeScript)
Notes
When developing with Jimmer, there is a note of caution that needs attention. Please refer to here