Filtering DataGrid 2 objects with multiple values inserted inside single text field
0
Hello everyone, I ran into an interesting situation recently. I was trying to create a Datagrid 2 text filter containing multiple IDs to display only items in which the id is included in that string. However I was unable to make that happen without adding new associated entity with boolean attribute like shouldBeIncluded for each item, but that not only forced me to make that entity PE (NPE cannot be used in Xpath of the DataGrid2, because this relation would start with with entity which is not persistable <- this is the error I got when trying to do so), but also it means that there is a lot of trash data in my DB. I also don't like the fact I just want these items with shouldBeIncluded attribute to exist when I am filtering the table and sure I could delete them when user changes input, but what if he leaves somehow the page. My DB will start to store more and more leftovers.Is there any legitimate way to approach this? What I want is to write in my ItemId filter something like: 1,2,3,4,5 and then for DataGrid2 to only display objects with IDs: 1,2,3,4,5. Thanks for all the help! PS. I need to keep Datasource as Database, because I am using pagination etc.