blaze-persistence icon indicating copy to clipboard operation
blaze-persistence copied to clipboard

New filter mapping mechanism based on mapping expressions

Open beikov opened this issue 3 years ago • 0 comments

Certain users would like to provide filtering mechanisms also for views that do not expose certain data through attribute mappings. So far, the way to go here is for users to make use of view filters, but the parametrization of these usually is through optional parameters, which is not very great from a usability PoV. It would be awesome if we had a mix of attribute and view filters, in the sense that the filter is named and has a single strongly typed parameter. One particular issue with the strongly typed aspect is, that in the annotation processor, it is very hard to determine the type of an expression, so it might be best to limit support to simple path expressions for now, as we can infer the type of these.

Something like this (names tbd):

@FilterMapping(name = "CreationUserNameFilter", expression = "creationUser.name", filter = StartsWithFilter.class)
public interface MyView { ... }

and usage in EntityViewSetting like this:

// Untyped dynamic
setting.addFilter("CreationUserNameFilter", "filter value")
// or typed via static metamodel
setting.addFilter(MyView_.filter_CreationUserNameFilter", "filter value")

beikov avatar May 20 '22 14:05 beikov