-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Fixes to primaryKey generation. #14351
Conversation
This reverts commit 5f85972.
@yelhouti take a look at the tests if it is the outcome you need. |
@@ -320,6 +199,193 @@ function prepareEntityForTemplates(entityWithConfig, generator) { | |||
return entityWithConfig; | |||
} | |||
|
|||
function prepareEntityPrimaryKeyForTemplates(entityWithConfig, generator, enableCompositeId = true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mshima that is a very good idea for blueprints who don't want to support compositeIds.
@mshima first of all, thanks for taking the time and all you are doing for the project. Although I don't understand why we need something this complicated (I might be missing something), I think that moving the logic of: prepareEntityPrimaryKeyForTemplates is a great step forward. I realize that we won't be implementing the compositeKey of the templates in the main repo so I will stop trying to push things my way and override what I don't like in my blueprints. I will try to make a PR that changes thing I don't like, and maybe it will break something I will understand better, in the mean time, please, just go ahead an merge this. Just for the record, the main things I don't like, is that we have new |
This is a developer preference. Apart from the implementation approach, it should be done lazily, because the info is not there yet.
We can implement composite key in the the templates, but I'm against implementing it as What I think you have missed the point is that if the compositeId was merged as I've proposed (a mapped field), it would be much less code to override at your blueprint.
Great, thanks.
They only have some additional fields related to the id, so IMO it's not a problem. The
Thanks. |
to.deep.include
instead ofto.containSubset
, output in case of error is not useful for the later.Please make sure the below checklist is followed for Pull Requests.
When you are still working on the PR, consider converting it to Draft (bellow reviewers) and adding
skip-ci
label, you can still see CI build result at your branch.