Hi Frans,
I know that entities based on DB views is something you're working on for the next release, but I wanted to check something with you before i go too far down an implementation route:
I have a view that is basically a de-normalised view of users and thier relationship with various things, e.g.:
UserID * Record_Type * Record_ID
1 * POLICY * 1
1 * POLICY * 45
1 * LEGISLATION * 3
Now, what I want to is write code such as:
"List all policy records associated with userID 1"
Can I do this with predicates? I suspect the answer is "not currently"?
I also suspect that the solution for the time being is to fire 2 queries off to the DB:
1: "List all Record_IDs from the view where RecordType = POLICY and UserID = 1"
2: "List all policy records where ID's are in the comma-seperated list of record_IDs fetched in query #1."
My reservations about this solution is that its 2 database hits (not too big a deal though), and more importantly, that there is a limit on how many comma-seperated "things" you can filter on (think its a thousand). So this shortened SQL would fail:
Select * from policy where ID in (1,2,3...1001)
Thanks for your thoughts!