babyfish-ct / jimmer

A revolutionary ORM framework for both java and kotlin.
Apache License 2.0
873 stars 86 forks source link
cache caffine data draft fetch graphql immer immutable immutable-collections immutable-datastructures java jdbc kotlin orm redis redis-cache

logo

A revolutionary ORM framework for both java and kotlin, and a complete integrated solution

Switch Langue

English | 中文

1. Key features

2. Core Concept

The core concept of Jimmer is to read and write data structures of arbitrary shapes as a whole, rather than simply processing entity objects.

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?

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 `EntityGraphQL` is very complex; Jimmer provides two methods to achieve similar functionality: controlling the format of returned entity objects, or generating DTOs through a cost-effective way and querying directly. Either way is much simpler than `EntityGraph`
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 `ORM` to `OM`; Jimmer's automatically generated DTOs support arbitrarily complex hierarchical relationships, **Jimmer is currently the only ORM that supports nested projections based on DTO**
In JPA, updating an object results in all updatable columns being modified. For simplicity, developers rarely use `update`, instead choosing to first query the complete object, modify some properties, and finally save the entire object; Jimmer can construct and directly save incomplete objects
JPA's `EntityGraphQL` does not support recursive queries based on self-referencing properties, Jimmer does
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.

3. Comprehensive capabilities

feature

4. Ultimate performance

performance

5. Notes

Since Jimmer is a compile-time framework, and considering that not all users are familiar with apt and ksp, it's necessary to mention an important detail.

Apt/Ksp are standard technologies in the industry, and Java IDEs provide support for them.

6. Links