Support immutable entities
See original GitHub issue- add an
immutable
attribute on the@Table
annotation - introspection to use non default public constructor (probably another impl of BeanFactory)
- if multiple non default public constructors are found, pick one with
@DefaultConstructor
. If not found, raise exception - forbid setters on fields passed to the non default public constructor
- on fields that are not passed to non default public constructor, ensure setters are there
- check that all getters are present
Did I miss something @bric3 @KeepItSimpleStupid
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
@Immutable in Hibernate | Baeldung
In this article, we'll talk about how we can make an entity, collection or attribute Immutable in Hibernate. By default, fields are mutable, ......
Read more >Support immutable entity updates · Issue #11457 · dotnet/efcore
Issue #10703 covers materialization of entities with constructors, which allows immutable entities to be used with EF Core. However, since these entities ......
Read more >Immutability and Entity Framework Core - Medium
One core feature is the implementation of the unit of work pattern by supporting, what is usually called, a first level cache. Load...
Read more >Immutable objects when working with Entity Framework Core
EF Core does support immutability, more specifically it can utilize the constructors of your entities. This enables you to create purely ...
Read more >Immutable entities and value objects in EF Core! - Fati Iseni
How to implement and persist immutable entities and value object in Entity Framework Core.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I would also rename the annotation
@DefaultConstructor
to@EntityCreator
(similar to Jackson’s@JsonCreator
)https://github.com/doanduyhai/Achilles/wiki/Achilles-Annotations#immutable
Released in Achilles 5.3.0