mikeg22 wrote:
Otis wrote:
If you formulate the IDbCommand object in the IActionQuery and IRetrievalQuery object passed in these routines in such a way they call your proc, you can do it of course. Though it will be some work which will likely be void when 1.0.2005.1 comes out, which supports inheritance (entity mapped on multiple targets)
I'm not sure I understand what you mean by "entity mapped on multiple targets." Can you explain this or point me to some information elsewhere?
In the next upgrade, you'll be able to map entities in a hierarchy, with supertypes/subtypes. So you have for example Employee with subtype Manager which has a subtype Boardmember. All these entities are mapped on different tables. This means that Boardmember has fields from 3 different entities and when saved it has to save (or update or delete) in 3 different tables.
What is also a problem is that with recursive saves, and unit of work commits, you can't simply call a method and be done with it, you have to setup the proc calls yourself for each entity.
We wouldn't need proc calls for saves, I think LLBLGEN can do that stuff fine, supposing we can figure out a way to limit the saving to specific fields (some fields in the entity should not be updateable by some users, which can be determined by security objects that will be in memory). It is only the initial loading of the entities that doesn't fit with the model we are making. My goal here is just to control what data gets loaded via the stored procedures which contain our retrieval security code, and hopefully LLBLGEN can do the rest.
Well, if you derive a class from DataAccessAdapter, and in there override ExecuteMultiRowRetrievalQuery(), and you can intercept the fetch calls. ExecuteSingleRowRetrievalQuery().
The problem for you then is to figure out which proc to call, so you might as well override FetchEntityCollection and FetchEntity and friends. Which can signal (by setting a flag for example) which proc to call based on the entity specifications they receive.
Execute*RowRetrievalQuery() receive an IRetrievalQuery object. That object has a Command property (cast to RetrievalQuery first). Which is an IDbCommand object. You then have to modify that to call the proper proc, set the CommandType to procedure and eventually set parameters again.
Be aware that if the call specifies any filters, you've to call a different proc for example.