-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Query: Optimize usage of GetViewOrTableMappings
Resolves #23572 Following rules define if given entity type is a potential candidate for optional dependent in table sharing case - A keyless entity cannot be in table sharing - Only root type of hierarchy can be dependent - The dependent can be TPH/TPT (or no hierarchy) but no TPC - Principal can be any type except non-leaf type in TPC (this is only applied in model validation, no impact on query) If above conditions indicate it is optional dependent then we need to find the ITableBase it is mapped to find if it is optional dependent We find ITableBase for IEntityType (which is also root type) - For new generated SelectExpression, first table's ITableBase is the mapping table (regardless of type of TableExpressionBase, if no mapping then we use default) - For other scenario the single mapped view/table mapping for the entity type (because of root type, there will only be one mapping) or default mapping in case entity type is not mapped to any view/table Once we get table and verify it is optional dependent, We use required non-PK columns which are not shared with principal entity types to add check for existence. This is necessary and sufficient condition for existence
- Loading branch information
Showing
16 changed files
with
3,984 additions
and
7,529 deletions.
There are no files selected for viewing
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
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
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
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
Oops, something went wrong.