schematic
schematic copied to clipboard
@InexactContentUri whereColumns joined via OR
Currently I'm trying to set a @InexactContentUri where the whereColumn can be any of 2 columns in my table. I would requiere the where clause to be: WHERE whereColumn1 = pathSegment OR whereColumn2 = pathSegment
This seems to be impossible with the current setup because whereColumn are joined with an AND. Would be good to have an option to join them via an OR Or alternatively make the where work without require the whereColumn parameter. I tried to use the where parameter but currently it doesn't allow the whereColumn clause to be empty. Also couldn't find a way on how the where clause could use the path segments.
Yeah, that's not possible right now. I think it's too hard to do anything but the simplest use-cases with a single annotation.
Maybe @InexactContentUri
should just be killed, and @ContentUri
on a method should always be accompanied with a @Where
annotated method.
As well as the previous suggestion, some convenience annotations could be added. E.g. @IdContentUri
and @RangeContentUri
.
I also noticed that whereColumn and pathSegment are mandatory in InexactContentUri.
I was planning to have a very custom where clause with question marks in it and than have path segments or query params of the Uri to be selectionArgs.
It's of course not straightforward to do. But instead of RangeContentUri, to solve the issue described here, we could have a where
clause with OR in it and have arguments coming from method params.