-
Notifications
You must be signed in to change notification settings - Fork 683
Investigate factory methods as alternative entity creation mechanism #2476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
odrotbohm
pushed a commit
that referenced
this issue
Feb 15, 2022
odrotbohm
added a commit
that referenced
this issue
Feb 15, 2022
Move to @PersistenceCreator as canonical annotation to explicitly express constructors and methods to be used to create domain object instances from persistence operations. Removed @factorymethod as it's not needed anymore. @PersistenceConstructor is now deprecated. Renamed EntityCreatorMetadata(Support|Discoverer) to InstanceCreatorMetadata(Support|Discoverer) to avoid further manifestation of the notion of an entity in the metamodel as it's not used to only handle entities. Issue #2476.
odrotbohm
added a commit
that referenced
this issue
Feb 15, 2022
Move simple Spring Converter implementation that allow to create DTOs from a source object previously copied amongst a variety of store modules. Issue #2476.
odrotbohm
added a commit
that referenced
this issue
Feb 15, 2022
Move simple Spring Converter implementation that allow to create DTOs from a source object previously copied amongst a variety of store modules. Issue #2476.
odrotbohm
pushed a commit
that referenced
this issue
Feb 16, 2022
odrotbohm
added a commit
that referenced
this issue
Feb 16, 2022
Move to @PersistenceCreator as canonical annotation to explicitly express constructors and methods to be used to create domain object instances from persistence operations. Removed @factorymethod as it's not needed anymore. @PersistenceConstructor is now deprecated. Renamed EntityCreatorMetadata(Support|Discoverer) to InstanceCreatorMetadata(Support|Discoverer) to avoid further manifestation of the notion of an entity in the metamodel as it's not used to only handle entities. Issue #2476.
odrotbohm
added a commit
that referenced
this issue
Feb 16, 2022
Move simple Spring Converter implementation that allow to create DTOs from a source object previously copied amongst a variety of store modules. Issue #2476.
odrotbohm
added a commit
that referenced
this issue
Feb 16, 2022
Move simple Spring Converter implementation that allow to create DTOs from a source object previously copied amongst a variety of store modules. Issue #2476.
schauder
added a commit
to spring-projects/spring-data-relational
that referenced
this issue
Oct 5, 2022
R2DBC now supports the use of factory methods for entity creation. Spring Data JDBC already does so via f326897 Simply annotate a static factory method on your entity class with `@PeristenceCreator`. Closes #1346 See spring-projects/spring-data-commons#2476 See f326897
schauder
added a commit
to spring-projects/spring-data-relational
that referenced
this issue
Oct 5, 2022
R2DBC now supports the use of factory methods for entity creation. Spring Data JDBC already does so via f326897 Simply annotate a static factory method on your entity class with `@PersistenceCreator`. Closes #1346 See spring-projects/spring-data-commons#2476 See f326897
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It would make sense to explore the support of how to create entities by using factory methods. Often times, immutable types come with factory methods (
of
,create
) instead of using the constructor mechanism for entity creation:The flip side is that factory methods were not considered at all and we need to determine how to enable the use of factory methods. Typically, factory methods contain validation while constructors don't.
The text was updated successfully, but these errors were encountered: