-
Notifications
You must be signed in to change notification settings - Fork 0
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
JNG-5103 Add the sub types references #145
base: develop
Are you sure you want to change the base?
JNG-5103 Add the sub types references #145
Conversation
gaborflorian
commented
Aug 16, 2023
•
edited by github-actions
bot
Loading
edited by github-actions
bot
|
…elations_of_subtypes
…elations_of_subtypes
…elations_of_subtypes # Conflicts: # judo-runtime-core-dao-rdbms/src/main/java/hu/blackbelt/judo/runtime/core/dao/rdbms/executors/SelectStatementExecutor.java # judo-runtime-core-dao-rdbms/src/main/java/hu/blackbelt/judo/runtime/core/dao/rdbms/query/RdbmsBuilder.java # judo-runtime-core-dao-rdbms/src/main/java/hu/blackbelt/judo/runtime/core/dao/rdbms/query/mappers/AttributeMapper.java # judo-runtime-core-dao-rdbms/src/main/java/hu/blackbelt/judo/runtime/core/dao/rdbms/query/mappers/ConstantMapper.java # judo-runtime-core-dao-rdbms/src/main/java/hu/blackbelt/judo/runtime/core/dao/rdbms/query/mappers/EntityTypeNameMapper.java # judo-runtime-core-dao-rdbms/src/main/java/hu/blackbelt/judo/runtime/core/dao/rdbms/query/mappers/FunctionMapper.java # judo-runtime-core-dao-rdbms/src/main/java/hu/blackbelt/judo/runtime/core/dao/rdbms/query/mappers/IdAttributeMapper.java # judo-runtime-core-dao-rdbms/src/main/java/hu/blackbelt/judo/runtime/core/dao/rdbms/query/mappers/RdbmsMapper.java # judo-runtime-core-dao-rdbms/src/main/java/hu/blackbelt/judo/runtime/core/dao/rdbms/query/mappers/SubSelectFeatureMapper.java # judo-runtime-core-dao-rdbms/src/main/java/hu/blackbelt/judo/runtime/core/dao/rdbms/query/mappers/SubSelectMapper.java # judo-runtime-core-dao-rdbms/src/main/java/hu/blackbelt/judo/runtime/core/dao/rdbms/query/mappers/TypeAttributeMapper.java # judo-runtime-core-dao-rdbms/src/main/java/hu/blackbelt/judo/runtime/core/dao/rdbms/query/mappers/VariableMapper.java # judo-runtime-core-dao-rdbms/src/main/java/hu/blackbelt/judo/runtime/core/dao/rdbms/query/model/RdbmsColumn.java # judo-runtime-core-dao-rdbms/src/main/java/hu/blackbelt/judo/runtime/core/dao/rdbms/query/model/RdbmsConstant.java # judo-runtime-core-dao-rdbms/src/main/java/hu/blackbelt/judo/runtime/core/dao/rdbms/query/model/RdbmsCount.java # judo-runtime-core-dao-rdbms/src/main/java/hu/blackbelt/judo/runtime/core/dao/rdbms/query/model/RdbmsEntityTypeName.java # judo-runtime-core-dao-rdbms/src/main/java/hu/blackbelt/judo/runtime/core/dao/rdbms/query/model/RdbmsField.java # judo-runtime-core-dao-rdbms/src/main/java/hu/blackbelt/judo/runtime/core/dao/rdbms/query/model/RdbmsFunction.java # judo-runtime-core-dao-rdbms/src/main/java/hu/blackbelt/judo/runtime/core/dao/rdbms/query/model/RdbmsNamedParameter.java # judo-runtime-core-dao-rdbms/src/main/java/hu/blackbelt/judo/runtime/core/dao/rdbms/query/model/RdbmsNavigationFilter.java # judo-runtime-core-dao-rdbms/src/main/java/hu/blackbelt/judo/runtime/core/dao/rdbms/query/model/RdbmsOrderBy.java # judo-runtime-core-dao-rdbms/src/main/java/hu/blackbelt/judo/runtime/core/dao/rdbms/query/model/RdbmsParameter.java # judo-runtime-core-dao-rdbms/src/main/java/hu/blackbelt/judo/runtime/core/dao/rdbms/query/model/RdbmsResultSet.java # judo-runtime-core-dao-rdbms/src/main/java/hu/blackbelt/judo/runtime/core/dao/rdbms/query/model/SqlConverterContext.java # judo-runtime-core-dao-rdbms/src/main/java/hu/blackbelt/judo/runtime/core/dao/rdbms/query/model/join/RdbmsContainerJoin.java # judo-runtime-core-dao-rdbms/src/main/java/hu/blackbelt/judo/runtime/core/dao/rdbms/query/model/join/RdbmsCustomJoin.java # judo-runtime-core-dao-rdbms/src/main/java/hu/blackbelt/judo/runtime/core/dao/rdbms/query/model/join/RdbmsJoin.java # judo-runtime-core-dao-rdbms/src/main/java/hu/blackbelt/judo/runtime/core/dao/rdbms/query/model/join/RdbmsNavigationJoin.java # judo-runtime-core-dao-rdbms/src/main/java/hu/blackbelt/judo/runtime/core/dao/rdbms/query/model/join/RdbmsQueryJoin.java # judo-runtime-core-dao-rdbms/src/main/java/hu/blackbelt/judo/runtime/core/dao/rdbms/query/model/join/RdbmsTableJoin.java
…elations_of_subtypes
…elations_of_subtypes # Conflicts: # judo-runtime-core-dao-rdbms/src/main/java/hu/blackbelt/judo/runtime/core/dao/rdbms/query/RdbmsBuilder.java
WalkthroughThe changes involve modifications to two classes: Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
judo-runtime-core-dao-rdbms/src/main/java/hu/blackbelt/judo/runtime/core/dao/rdbms/query/processor/ContainerJoinProcessor.java (1)
91-160
: Address the TODO for JNG-5103: Implement ancestor joinsThe commented-out code indicates an intention to handle ancestor joins by casting to ancestor join lists. Implementing this functionality is crucial for ensuring that joins correctly consider type hierarchies, which can improve query accuracy and performance.
I can assist in developing this feature to handle ancestor joins effectively. Would you like me to help implement this functionality or open a new GitHub issue to track this task?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
- judo-runtime-core-dao-rdbms/src/main/java/hu/blackbelt/judo/runtime/core/dao/rdbms/query/processor/ContainerJoinProcessor.java (3 hunks)
- judo-runtime-core-query/src/main/java/hu/blackbelt/judo/runtime/core/query/JoinFactory.java (5 hunks)
🧰 Additional context used
🪛 ast-grep
judo-runtime-core-query/src/main/java/hu/blackbelt/judo/runtime/core/query/JoinFactory.java
[warning] 166-167: Detected a cookie where the
Secure
flag is either missing or disabled. TheSecure
cookie flag instructs the browser to forbid sending the cookie over an insecure HTTP request. Set theSecure
flag totrue
so the cookie will only be sent over HTTPS.
Context: (
String.format("Reference with name %s cannot be found.", navigation.getFeatureName()))
Note: [CWE-614]: Sensitive Cookie in HTTPS Session Without 'Secure' Attribute [OWASP A05:2021]: Security Misconfiguration [REFERENCES]
- https://owasp.org/Top10/A05_2021-Security_Misconfiguration
[warning] 172-174: Detected a cookie where the
Secure
flag is either missing or disabled. TheSecure
cookie flag instructs the browser to forbid sending the cookie over an insecure HTTP request. Set theSecure
flag totrue
so the cookie will only be sent over HTTPS.
Context: (!reference.isDerived(),
String.format("Derived references must be resolved by expression builder: %s (%s)",
reference.getName(), modelAdapter.getFqName(reference.eContainer())))
Note: [CWE-614]: Sensitive Cookie in HTTPS Session Without 'Secure' Attribute [OWASP A05:2021]: Security Misconfiguration [REFERENCES]
- https://owasp.org/Top10/A05_2021-Security_Misconfiguration
[warning] 166-167: Detected a cookie where the
HttpOnly
flag is either missing or disabled. TheHttpOnly
cookie flag instructs the browser to forbid client-side JavaScript to read the cookie. If JavaScript interaction is required, you can ignore this finding. However, set theHttpOnly
flag to true` in all other cases.
Context: (
String.format("Reference with name %s cannot be found.", navigation.getFeatureName()))
Note: [CWE-1004]: Sensitive Cookie Without 'HttpOnly' Flag [OWASP A05:2021]: Security Misconfiguration [REFERENCES]
- https://owasp.org/Top10/A05_2021-Security_Misconfiguration
[warning] 172-174: Detected a cookie where the
HttpOnly
flag is either missing or disabled. TheHttpOnly
cookie flag instructs the browser to forbid client-side JavaScript to read the cookie. If JavaScript interaction is required, you can ignore this finding. However, set theHttpOnly
flag to true` in all other cases.
Context: (!reference.isDerived(),
String.format("Derived references must be resolved by expression builder: %s (%s)",
reference.getName(), modelAdapter.getFqName(reference.eContainer())))
Note: [CWE-1004]: Sensitive Cookie Without 'HttpOnly' Flag [OWASP A05:2021]: Security Misconfiguration [REFERENCES]
- https://owasp.org/Top10/A05_2021-Security_Misconfiguration
🔇 Additional comments (8)
judo-runtime-core-query/src/main/java/hu/blackbelt/judo/runtime/core/query/JoinFactory.java (6)
84-88
: Improved method signature formattingThe method signature has been reformatted to span multiple lines, which enhances readability without changing functionality. This is a good practice for methods with multiple parameters.
120-121
: Consistent logging formatThe logging statement has been reformatted to use string concatenation, which aligns with the formatting of other logging statements in the codebase. This change enhances consistency without altering the log output.
137-140
: Improved feature conversion formattingThe feature conversion call has been reformatted to span multiple lines, consistent with the earlier method signature change. This improves readability without altering the conversion logic.
153-168
: Enhanced reference handling and error reportingThe changes introduce a more robust approach to handling references:
- Use of
Optional<EReference>
for initial reference retrieval.- Fallback mechanism to search for references in all entity types if not found initially.
- Updated error message for missing references, providing more specific information.
These improvements enhance the reliability of reference handling and provide better error diagnostics, which aligns well with the PR objective of resolving navigation issues related to inherited container fields.
🧰 Tools
🪛 ast-grep
[warning] 166-167: Detected a cookie where the
Secure
flag is either missing or disabled. TheSecure
cookie flag instructs the browser to forbid sending the cookie over an insecure HTTP request. Set theSecure
flag totrue
so the cookie will only be sent over HTTPS.
Context: (
String.format("Reference with name %s cannot be found.", navigation.getFeatureName()))
Note: [CWE-614]: Sensitive Cookie in HTTPS Session Without 'Secure' Attribute [OWASP A05:2021]: Security Misconfiguration [REFERENCES]
- https://owasp.org/Top10/A05_2021-Security_Misconfiguration
[warning] 166-167: Detected a cookie where the
HttpOnly
flag is either missing or disabled. TheHttpOnly
cookie flag instructs the browser to forbid client-side JavaScript to read the cookie. If JavaScript interaction is required, you can ignore this finding. However, set theHttpOnly
flag to true` in all other cases.
Context: (
String.format("Reference with name %s cannot be found.", navigation.getFeatureName()))
Note: [CWE-1004]: Sensitive Cookie Without 'HttpOnly' Flag [OWASP A05:2021]: Security Misconfiguration [REFERENCES]
- https://owasp.org/Top10/A05_2021-Security_Misconfiguration
170-175
: Improved reference validation checksThe reference validation checks have been updated:
- The check for unknown references now uses a more concise format.
- The check for derived references has been reformatted for consistency.
These changes maintain the same logical checks while improving code readability and error message clarity.
🧰 Tools
🪛 ast-grep
[warning] 172-174: Detected a cookie where the
Secure
flag is either missing or disabled. TheSecure
cookie flag instructs the browser to forbid sending the cookie over an insecure HTTP request. Set theSecure
flag totrue
so the cookie will only be sent over HTTPS.
Context: (!reference.isDerived(),
String.format("Derived references must be resolved by expression builder: %s (%s)",
reference.getName(), modelAdapter.getFqName(reference.eContainer())))
Note: [CWE-614]: Sensitive Cookie in HTTPS Session Without 'Secure' Attribute [OWASP A05:2021]: Security Misconfiguration [REFERENCES]
- https://owasp.org/Top10/A05_2021-Security_Misconfiguration
[warning] 172-174: Detected a cookie where the
HttpOnly
flag is either missing or disabled. TheHttpOnly
cookie flag instructs the browser to forbid client-side JavaScript to read the cookie. If JavaScript interaction is required, you can ignore this finding. However, set theHttpOnly
flag to true` in all other cases.
Context: (!reference.isDerived(),
String.format("Derived references must be resolved by expression builder: %s (%s)",
reference.getName(), modelAdapter.getFqName(reference.eContainer())))
Note: [CWE-1004]: Sensitive Cookie Without 'HttpOnly' Flag [OWASP A05:2021]: Security Misconfiguration [REFERENCES]
- https://owasp.org/Top10/A05_2021-Security_Misconfiguration
166-168
: Addressing static analysis hintsThe static analysis tool has flagged potential security issues related to cookie handling (missing
Secure
andHttpOnly
flags). However, these warnings appear to be false positives:
- This code is not related to web applications or cookie handling.
- The warnings are likely triggered by the use of
String.format()
, which is commonly used in cookie-related code but has many other uses as well.We can safely ignore these warnings as they are not applicable to this context.
Also applies to: 172-175
🧰 Tools
🪛 ast-grep
[warning] 166-167: Detected a cookie where the
Secure
flag is either missing or disabled. TheSecure
cookie flag instructs the browser to forbid sending the cookie over an insecure HTTP request. Set theSecure
flag totrue
so the cookie will only be sent over HTTPS.
Context: (
String.format("Reference with name %s cannot be found.", navigation.getFeatureName()))
Note: [CWE-614]: Sensitive Cookie in HTTPS Session Without 'Secure' Attribute [OWASP A05:2021]: Security Misconfiguration [REFERENCES]
- https://owasp.org/Top10/A05_2021-Security_Misconfiguration
[warning] 166-167: Detected a cookie where the
HttpOnly
flag is either missing or disabled. TheHttpOnly
cookie flag instructs the browser to forbid client-side JavaScript to read the cookie. If JavaScript interaction is required, you can ignore this finding. However, set theHttpOnly
flag to true` in all other cases.
Context: (
String.format("Reference with name %s cannot be found.", navigation.getFeatureName()))
Note: [CWE-1004]: Sensitive Cookie Without 'HttpOnly' Flag [OWASP A05:2021]: Security Misconfiguration [REFERENCES]
- https://owasp.org/Top10/A05_2021-Security_Misconfigurationjudo-runtime-core-dao-rdbms/src/main/java/hu/blackbelt/judo/runtime/core/dao/rdbms/query/processor/ContainerJoinProcessor.java (2)
68-76
: Construction ofcontainerJoin
is well-structuredThe creation of the
containerJoin
using the builder pattern enhances code readability and maintainability. All necessary parameters are appropriately set, and the use ofRdbmsContainerJoin.builder()
consolidates the join's properties effectively.
89-89
: Ensure the order of joins in the result list is correctAdding
containerJoin
to theresult
list after processing the simple joins may have ordering implications. Verify whethercontainerJoin
should be added before or after the simple joins to maintain the correct join sequence in the SQL query.To confirm the join order, you can check the dependencies and execution plan using the following script:
✅ Verification successful
Join order is correct
The
containerJoin
is the only join being added to theresult
list inContainerJoinProcessor.java
, ensuring the correct sequence in the SQL query.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Analyze the join order in the generated SQL queries. # Test: Search for the usage of 'containerJoin' and inspect its position relative to other joins. rg -A 5 "result\.add\(containerJoin\)"Length of output: 1068
Script:
#!/bin/bash # Description: Retrieve all join additions in ContainerJoinProcessor.java to verify their order. rg "result\.add\(" judo-runtime-core-dao-rdbms/src/main/java/hu/blackbelt/judo/runtime/core/dao/rdbms/query/processor/ContainerJoinProcessor.java -A 5Length of output: 418