mma02 wrote:
This requirenment is not new, there was an assumption that we can extand LLBLGEN to fit our needs.
though, if we try to advise you something, and you say it's not a good alternative because there's 2 months till a deadline, that's a bit odd, as you should have taken this into account from the get go. Appending something to a query and assume that will work in all occasions is not matching reality for whatever framework you'll use, as the query you're appending to can have unlimited different forms.
creating a view per entity - besides being a huge amount of work, is not a good solution
becouse:
1, every new table will have to get a matching view.
2, we use oracle and this db uses views not optimaly - when you run a select query, the view is first created and then your query is run against the view - this is a big performance hit.
A view's sql is inlined in the query, unless you're using an old version of oracle. You can also use indexed views to overcome this.
I don't understand why we need to discuss our architecture decisions,
Because you ask us for a solution but the easy solutions we gave you weren't doable according to you (as the easy solution, our authorization system is, you said, too much work, which I disagree with) and in the end it will turn out to be a weak spot of our framework while that is in reality not the case. Also you didn't answer my question about the storage of the row security which is essential for your problem. I asked this because a requirement to have for every row in every table a second row somewhere which will show if the initial row is fetchable is either actually pretty straight forward (e.g. very simple value testing and the range of values is very small) or it's a deep group based security system and what you want with tables is not really something doable in practice as maintenance of these security table data is very complex so that's why I asked how you want to do this.
i have described a senario we're trying to achieve, please help me get it done.
We do, but all options we've given are not sufficient according to you, so there's little room left for us. As I said, you can append sql to queries, you can always do that, but it's very very cumbersome to make that fail safe (due to the aliasing). It's error prone with linq as aliases won't match in a lot of cases and this will result in you running into problems with crashes at runtime and 10 to 1 these will very hard to track down and will be posted here as "some query crashes" which will take a lot of time to solve. I want to avoid all that. I can assure you, appending sql to the SQL generated from linq queries is not going to be easy, and will fail in a lot of situations, however it will be hard to track down if it's your (your appender is wrong) or our fault (bug in linq provider).
We added a deep authorization system to our entity system some time ago and it works at every level, even field value read/write and in databinding, precisely for situations like the one you're in: fine-grained security throughout the application at the entity level. I really fail to see how this is 'more work', as it's simply not more work (likely 1 class you can share among many ifnot all entity classes). It's not something that works in the db, true, but why does it have to work in the DB ? You consume the data OUTSIDE the db and saves/deletes have to be taken into account as well for security, or are you doing those through stored procs?
this senario is not out there for my opinion, it is legitimate to want to add a join + filter to another table when executing a select statement using the tool's object model, don't you think?
sure, specify the join in the query. But you want to add it somewhere in the pipeline and there it goes wrong.
What if the table you've to join with has alias LPA_L1, and is in a derived table 3 levels deep? How are you going to add that join to that table? And what will the filter look like?
I ask these questions to get an overview to see if there are alternatives. As I said earlier, it's very very cumbersome to do this the way you want to do this, which is the most hardest way to get this done, if possible at all.
I understand you're in a tough position right now, but so am I: you ask us for help, we try to give that to you, but these options aren't sufficient so it leaves us with one other option: it won't work in your situation. That will likely cause a big problem for you and your project, and I don't want to take the responsibility for that when our framework can't do something you want and the project fails.
If you must, in Adapter, you can intercept anything, every query being generated you can intercept and adjust, just look at the reference manual and then DataAccessAdapterBase class. You can also decide to use your own version of the Oracle DQE (as the sourcecode is at your disposal) and try to append tables there. I can assure you though, with linq queries, it's not going to be solid in many cases, because you first have to determine the alias of the table you've to join with and place the table with the security info INSIDE the right derived table.
The bottom line however is: how are you going to filter row R in table A based on some data in table B and how do A and B relate? I also really would like to know why our authorization system is more work than all of this?