Skip to content

Commit

Permalink
Bugfix ModelJoin and RtoM2M CrossStore interaction (#2561)
Browse files Browse the repository at this point in the history
* Bugfix ModelJoin and RtoM2M CrossStore interaction

* Bugfix ModelJoin and RtoM2M CrossStore interaction
  • Loading branch information
haroonsherjan authored Jan 23, 2024
1 parent caa18af commit f277336
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import meta::pure::store::*;
import meta::pure::metamodel::relation::*;
import meta::relational::metamodel::*;
import meta::pure::extension::*;
Expand Down Expand Up @@ -77,10 +78,10 @@ function <<access.private>> meta::pure::router::store::routing::modifyMappingBas
| let connection = $inScopeStores->map(s|$runtime->connectionByElementFailSafe($s))->distinct();
if(
$connection->size() == 1,
| $connection->toOne()->match(
| $inScopeStores->match(
$extensions.availableStores.localizeXStoreAssociation
->map(e|$e->eval($x, $inScopeClassMappings, $inScopeStores))
->concatenate([a:Connection[1] | $x;])->toOneMany()
->map(e|$e->eval($x, $inScopeClassMappings))
->concatenate([a:Store[*] | $x;])->toOneMany()
);,
| $x
);,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Class meta::pure::store::StoreContract extends meta::pure::router::extension::Ro
supports : Function<{FunctionExpression[1]->Boolean[1]}>[0..1];
supportsNativeJoinAmongElements : Boolean[1];
isPropertyAutoMapped : Function<{AbstractProperty<Any>[1], InstanceSetImplementation[1]->Boolean[1]}>[0..1];
localizeXStoreAssociation : Function<{XStoreAssociationImplementation[1], SetImplementation[*], Store[*] -> Function<{Nil[1]->AssociationImplementation[1]}>[*]}>[0..1];
localizeXStoreAssociation : Function<{XStoreAssociationImplementation[1], SetImplementation[*] -> Function<{Nil[1]->AssociationImplementation[1]}>[*]}>[0..1];
// ------------------------------------------------------------------------------------------ Routing

// ExecutionPlan Generation -------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ function meta::relational::contract::relationalStoreContract():StoreContract[1]
planGraphFetchExecution = meta::relational::contract::planGraphFetchExecution_StoreMappingLocalGraphFetchExecutionNodeGenerationInput_1__LocalGraphFetchExecutionNode_1_,
planCrossGraphFetchExecution = meta::relational::contract::planCrossGraphFetchExecution_StoreMappingCrossLocalGraphFetchExecutionNodeGenerationInput_1__LocalGraphFetchExecutionNode_1_,
localizeXStoreAssociation = {
x : XStoreAssociationImplementation[1], setImpl : SetImplementation[*], stores : Store[*] |
x : XStoreAssociationImplementation[1], setImpl : SetImplementation[*] |
[
d: DatabaseConnection[1]| meta::external::store::relational::modelJoins::localizeXStoreAssociation($x, $setImpl, $stores);
d: Database[*]| meta::external::store::relational::modelJoins::localizeXStoreAssociation($x, $setImpl, $d);
]
},
connectionEquality = { b : Connection [1] |
Expand Down

0 comments on commit f277336

Please sign in to comment.