-
Notifications
You must be signed in to change notification settings - Fork 7
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
Issue #2313 - Formalisation of fetch models #2322
Open
homedirectory
wants to merge
116
commits into
2.0.0-SNAPSHOT
Choose a base branch
from
Issue-#2313
base: 2.0.0-SNAPSHOT
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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
…ty and GeProperty
…pertyValidator RangePropertyValidator used a separate EntityUtils.validate*Range method for each supported property type. In RangeValidatorFunction this role is played by a single ComparableValidator, which is possible because all supported types implement Comparable. There were only 2 non-trivial cases: * Date: isAfter has the same semantics as compareTo * DateTime: isAfter has the same semantics as compareTo but also treats null as now. But since EntityUtils.validateDateTimeRange explicitly checks for non-nullness, this difference can be disregarded. And anyway, DateTime is no longer a supported property type.
…uring yields enhancement The FIXME is resovled: retrieval models now recognise presence of ID in synthetic entities. As IRetrievalModel.containsOnlyTotals had been introduced only for the purpose of special handling of ID, it is no longer needed as well.
Optional.filter().isPresent() is more efficient than Optional.map() because it doesn't perform allocation.
Introduce method signature with(propName) which explores entities by default. This change does not affect semantics. private void includeAllCompositeKeyMembers() { entityMetadataUtils.compositeKeyMembers(entityMetadata) - .forEach(pm -> with(pm.name(), !pm.type().isEntity())); + .forEach(pm -> with(pm.name())); } The above piece is also unaffected, as entity exploration skipping would have been true only for non-entity typed properties...
Optional.filter().isPresent() is more efficient than Optional.map() because it doesn't perform allocation.
…lledQuerySourceInfoMap
It had already been effectively immutable due to the use of method `copy` but still used mutable data structures for internal state, which was not a strong invariant.
… property The main change is in Source1BasedOnQueries.produceQuerySourceInfoForEntityType. Implementin this required IDomainMetadata to be accessible to Source1BasedOnQueries. Its `transform` method takes a TransformationContextFromStage1To2 as an argument, so I considered it reasonable to enhance that type with a IDomainMetadata component. The bulk of changes is related to this enhancement.
Prior to this change, the following example query would have failed: select(select(Vehicle.class).yieldAll().modelAsAggregate()) .yield().prop("id").as("id") .modelAsEntity(Vehicle.class)
QuerySourceInfoProvider is more suited to contain this method as it is similar to other methods declared by it - most of them produce instances of QuerySourceInfo.
…ly used in a source query
And the returned null wasn't being handled.
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.
Resolve #2313