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
Load methods return a new instance (distinguish strictly between model and entity) #862
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mvorisek
force-pushed
the
distinguish_model_and_entity
branch
6 times, most recently
from
April 24, 2021 07:11
aef589b
to
6b0789e
Compare
mvorisek
force-pushed
the
distinguish_model_and_entity
branch
9 times, most recently
from
April 25, 2021 07:54
40a2332
to
8955b81
Compare
mvorisek
commented
Apr 25, 2021
mvorisek
force-pushed
the
distinguish_model_and_entity
branch
9 times, most recently
from
April 25, 2021 20:57
d30fe88
to
9f51887
Compare
mvorisek
force-pushed
the
distinguish_model_and_entity
branch
from
May 5, 2021 18:05
cb78074
to
bb53f41
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For 3.0 release 🚀
Definitions
MODEL
Instance of
Model
class that is supposed to model data/relations, but can not hold/contain any record data.ENTITY
Instance of
Model
class that is supposed to hold/contain record data, but they can be modelled only using MODEL (described above).The instance/object is locked with specific ID once it is loaded/inserted from/to DB.
Migration
Model data like now. To manipulate with the actual data, you need to create another instance from MODEL using
createEntity()
method to create a new entity or using{,try}load{,One,Any}()
methods which now return a new instance - ENTITY.Mistake safety
If and only if we can distinguish strictly between model and entity, then all wrong usage will throw and no code can keep working if used wrongly.