feat: EXPOSED-77 Support entity class for table with composite primary key #1987
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.
Phase 1:
CompositeIdTable
that allows id columns to be marked forEntityID
inclusion usingColumn.compositeEntityid()
.CompositeID
that will be wrapped byEntityID
for value comparison.CompositeIdTable.id
can be used in DSL in the same way anyIdTable.id
can (for example, in WHERE or SELECT clauses). This means users can easily include all deconstructed PK columns in their queries.ResultRow[CompositeIdTable.id]
is also possible. Even though the result set returns each PK column value separately, using the previous accessor returns a newEntityID<CompositeID>
, just as for a standard entity id column.IdTable
subtype has been extracted (in most places) to the lowest common point possible.Phase 2 - About References:
This PR currently includes minimal changes to Reference logic (only for
referencedOn
). The better option seems to be to add a property to all reference classes. This new property would provide the full set of reference columns, while leaving the original single columnreference
property as an internal delegate (like an ambassador for the other columns), especially when it comes to managing the reference entity in the cache.Ideally I'd split this PR into 2, but support isn't really complete until referencing is working, so I'd like for this to be an iterative process, if possible.
Once everything is agreed on with the first phase, I'll commit the improved reference changes for review.