-
Notifications
You must be signed in to change notification settings - Fork 934
Fix OData filtering by a base class member #2387
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
Conversation
@@ -87,6 +87,9 @@ public IASTNode Translate(ISessionFactoryImplementor sessionFactory, bool filter | |||
|
|||
var requiredHqlParameters = new List<NamedParameterDescriptor>(); | |||
var queryModel = NhRelinqQueryParser.Parse(_expression); | |||
// Use the modified TransparentIdentifierRemovingExpressionVisitor in order to support expressions that were created | |||
// programmatically and do not mimic what the C# compiler generates. | |||
queryModel.TransformExpressions(TransparentIdentifierRemovingExpressionVisitor.ReplaceTransparentIdentifiers); |
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.
Fortunately that is cached in the query plan cache, so it is acceptable to traverse it again I think.
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.
I agree, the only thing that we could do is to make the capacity of the query cache configurable as currently is hardcoded to 128
private readonly SoftLimitMRUCache planCache = new SoftLimitMRUCache(128); |
which may be a little to small for larger applications. Of course, this should be done in a separate PR.
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.
Of course, this should be done in a separate PR.
Especially since that could be a deep rabbit hole. I think we should instead get rid of this SoftLimitMRUCache
and use something like System.Runtime.MemoryCache
.
The limit is hardcoded to 128, but that is not a strong limit. SoftLimitMRUCache
uses only weak references past 128 entries and lets the garbage collector decides whether to free them or not.
Fixes #2380