Hey there!
I have a problem: On lists shown in my application I have added sorting when pressing any header of any column. A list which is shown does not only consist of data from one DB table, e.g. showing a list of orders, and each order is created by someone, that is just a foreign key to another table, but I still want to be able to sort on the username, so to handle this I'm using the following:
Pass an OrderCollection to the FetchEntityCollection()
Pass a relation from OrderEntity to UserEntity to the FetchEntityCollection()
Pass the SortExpression to the FetchEntityCollection()
However this has revealed some problems when data in the columns are allowed to be null in the DB. I have made it so that the IEntityRelation is only added to the bucket if I'm sorting on any of the foreign key fields, otherwise not. So when showing the list initially the list is showing fine, but then if I sort by username, I pass the relation on to the bucket and thereby all orders which has null as value in foreign key to user are not fetched because of the INNER JOIN which is generated by the relation object.
So basically my question is: How to handle relations when foreign keys are allowed to be null?