AV when enabling filter


I am trying the filter feature.

I declare it in the class definition:

TLabel = class
[FilterDef('LanguageFilter', '{LangId} = :LangId')]
[FilterDefParam('LanguageFilter', 'LangId', TypeInfo(int64))]

I use RegisterEntity for this class

When I call Enable Filter ('LanguageFilter').SetParam('LangId', 5) I have an acess violation apparently in :

function TMappingExplorer.FindFilterDef(
const FilterName: string): TFilterDefinition;
Result := FFilterDefs.Find(FilterName);

as if FFilterDefs is not assigned

Any hint ?



Your code looks normal, maybe the problem is somewhere else. Are you sure the TMappingExplorer is created, or was not destroyed? Any steps to reproduce the issue?

We have detected there is an issue indeed here. Next update (to be released very soon, next week) will include the fix.
The current workaround is to explicitly pass the mapping explorer when creating the object manager:

Manager := TObjectManager.Create(Connection, TMappingExplorer.Default);

Many thanks Wagner.

It works, but if I call EnableFilter before an entity was retrieved from the database, I have the message "Filter definition not found"

Since I want to enable the filter right after the manager was created, as a workaround I perform a Manager.Find before calling EnableFilter

Thank you, this will also be fixed.

Both issues fixed with Aurelius 5.1.
Many thanks for this great piece of software !


This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.