I show this problem with a simple example:

I have a table “AB” in my DB. It is “many to many” relationships table. AB container has it.

Id A B

1 1 1

2 2 2

3 3 1

4 3 2

I use filter: AB.addContainerFilter(new Compare.Equal(“A”, 3)); I get the last two lines that is fine. When I delete the last one. I do AB.removeAllContainerFilters(); and get the container with data:

Id A B

1 1 1

2 2 2

3 3 1

That’s fine.

When I use filter: AB.addContainerFilter(new Compare.Equal(“A”, 1)); I get the first line: (1; 1; 1;). BUT the size of this filtered container is 0 instead of 1.

Size() function for containers is:

public int size() {

updateCount();

return size + sizeOfAddedItems() - removedItems.size();

}

In this case size = 1, sizeOfAddedItems() = 0, removedItems.size() = 1 (because I removed one item). So the total by this calculation is 0 and it is the reason why I get it. But it should be 1. I tried using the function refresh() but it didn’t help. How to solve that?

Thank you in advance