ObjectFactory fails to map reserved field names#7132
Merged
Conversation
| } | ||
| } | ||
|
|
||
| if (CoreSchema.getInstance().getSqlDialect().isReserved(name)) |
Contributor
There was a problem hiding this comment.
If this is supported, then I would not include these warnings (or lower to DEBUG). Customers will see these and ask us how to resolve the problem. If this is not fully supported...
Contributor
Author
There was a problem hiding this comment.
Good point. log removed for user defined domains.
labkey-matthewb
approved these changes
Oct 20, 2025
This file contains hidden or 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
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.
Rationale
A recent change to how file fields are displayed in Sample Timeline revealed a flaw in our audit log query utils. Specifically, AuditLogService.getAuditEvents fails to populate the event beans if any of the event field name happens to be in the sql dialect's reservedWordSet. For example, "File" is a reserved word for SQL Server, but not for postgresDB. When a column is a reserved word, it's alias to "col_", "col_1"... in the select sql. The ResultSet uses "col_" as the column name, and has no knowledge of its original name, which results in bean property mapping failure.
This PR adds a workaround to allow mapping ignoring trailing "_". It also logs warning about reserved word being added to domain.
Something to consider for future work: the set of reserved word is large, and contains words like "case", "primary" that seems harmless to use as domain fields, so it's not practical to disallow them in user domains.
SMSampleTimelineBasicTest.testFileFields (MSSQL)
NPE when loading sample timeline with file field changes
Related Pull Requests
Changes