-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add test which introduces a EntityClass that has a CA 'QueryView' and a navigation property to exercise ECReferenceTypesCache #222
Open
nick4598
wants to merge
14
commits into
main
Choose a base branch
from
nick/handlequeryView
base: main
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
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
4c16be3
initial commit
nick4598 1e36d7d
simpolify the queryview schema and rename it
nick4598 2639ea9
Change files
nick4598 7fd4cdd
also update node and pnpm
nick4598 e74c001
9.14.2
nick4598 2d6b59c
remove package manager because it conflicts with github actions??
nick4598 0302eeb
dont run queryView tests if itwinjs core version is too old
nick4598 47c9ccd
Update packages/transformer/src/ECReferenceTypesCache.ts
nick4598 2f0454a
Update packages/transformer/src/ECReferenceTypesCache.ts
nick4598 a5bb5de
update comment
nick4598 d553f90
Merge branch 'nick/handlequeryView' of https://github.com/iTwin/imode…
nick4598 4edc7f6
move to private function and also time the checking of queryView. Pro…
nick4598 a557cfd
Update .github/workflows/ci.yml
nick4598 504301d
Update .github/workflows/ci.yml
nick4598 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
7 changes: 7 additions & 0 deletions
7
change/@itwin-imodel-transformer-0f5a9c89-c313-4e41-acd0-5e20e991c35f.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "patch", | ||
"comment": "handle queryViews with navigationProperties in the ECreferenceTypesCache", | ||
"packageName": "@itwin/imodel-transformer", | ||
"email": "22119573+nick4598@users.noreply.github.com", | ||
"dependentChangeType": "patch" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,8 +43,8 @@ | |
"node": ">=16" | ||
}, | ||
"pnpm": { | ||
"overrides": { | ||
"semver": "^7.5.2" | ||
} | ||
"overrides": { | ||
"semver": "^7.5.2" | ||
} | ||
} | ||
} |
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
35 changes: 35 additions & 0 deletions
35
packages/transformer/src/test/assets/TestQueryView.ecschema.xml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ECSchema schemaName="TestGeneratedClassesNew" alias="tgcn" version="1.0.0" | ||
xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2"> | ||
<ECSchemaReference name="CoreCustomAttributes" version="01.00.03" alias="CoreCA"/> | ||
<ECSchemaReference name="BisCustomAttributes" version="01.00.00" alias="bisCA"/> | ||
<ECSchemaReference name="ECdbMap" version="02.00.04" alias="ecdbmap"/> | ||
<ECSchemaReference name="BisCore" version="01.00.16" alias="bis"/> | ||
|
||
<ECEntityClass typeName="TestView" modifier="Abstract" displayLabel="Test View" description="a sample view"> | ||
<ECCustomAttributes> | ||
<QueryView xmlns="ECDbMap.02.00.04"> | ||
<Query> | ||
SELECT | ||
pe.ECInstanceId, | ||
pe.ECClassId, | ||
pe.Yaw as Yaw, | ||
NAVIGATION_VALUE(bis.PhysicalElement.Parent, pe.Parent.Id) as Parent | ||
FROM bis.PhysicalElement pe | ||
</Query> | ||
</QueryView> | ||
</ECCustomAttributes> | ||
<ECProperty propertyName="Yaw" typeName="double" description="Yaw of the PhysicalElement"/> | ||
<ECNavigationProperty propertyName="Parent" relationshipName="PhysicalElementOwnsTestView" direction="backward" description="The parent Element that owns this element"/> | ||
</ECEntityClass> | ||
|
||
<ECRelationshipClass typeName="PhysicalElementOwnsTestView" strength="embedding" modifier="None" description="Relationship between an PhysicalElement and a TestView."> | ||
<Source multiplicity="(1..1)" roleLabel="owns" polymorphic="true"> | ||
<Class class="bis:PhysicalElement"/> | ||
</Source> | ||
<Target multiplicity="(1..*)" roleLabel="is owned by" polymorphic="true"> | ||
<Class class="TestView"/> | ||
</Target> | ||
</ECRelationshipClass> | ||
|
||
</ECSchema> |
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.
Oops, something went wrong.
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.
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.
@ColinKerr What is the recommended way to tell if a class is abstract or not?
Right now if targetType is undefined from calling
ECReferenceTypesCache.bisRootClassToRefType[targetRootBisClass.name];
That seems like a pretty good indicator that something is abstract, because it didn't have any matches for Element, Model, ElementAspect, or Relationship. But I do worry that it isn't foolproof. What if something else went wrong to cause us to get undefined? Right now the code assumes it is an error to get undefined and throws.