OnFetchTypedList override

Posts   
 
    
nada
User
Posts: 8
Joined: 07-Feb-2008
# Posted on: 11-Mar-2008 16:59:51   

I'm trying to prevent the DynamicQueryEngine from running the query that is generated and instead capture the SQL/parameters. When overriding the OnFetchTypedList method of the dataaccessadapter, what do you call to prevent the execution of the query against the database?

Even if I don't call the base method the query is still executed.

Thanks

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 12-Mar-2008 08:30:47   

I don't think that's possible. Anyway I'll escalate your question.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39903
Joined: 17-Aug-2003
# Posted on: 12-Mar-2008 09:38:27   

That's not easy, as the OnFetchTypedList is called prior to the execution, so whatever you do, it simply proceeds.

You have to override ExecuteMultiRowDataTableRetrievalQuery as well. You should set a flag in the DataAccessAdapter derived class (a boolean private field) when OnFetchTypedList is called, and in the override of ExecuteMultiRowDataTableRetrievalQuery, you should check the flag. If it's true, simply return, otherwise call the base' method.

Frans Bouma | Lead developer LLBLGen Pro
nada
User
Posts: 8
Joined: 07-Feb-2008
# Posted on: 12-Mar-2008 13:42:45   

Ok, the ExecuteMultiRowDataTableRetrievalQuery override work wells to stop the query from running. Is it still necessary to call the OnFetchTypedList override as well? I notice it never gets called if I return false from the ExecuteMultiRowDataTableRetrievalQuery override.

Is there a better way to just get the select statement and sql parameters without calling the adapter.fetchtypedlist?

nada
User
Posts: 8
Joined: 07-Feb-2008
# Posted on: 12-Mar-2008 13:45:20   

Sorry, it does call the onfetchtypedlist override first...i was mistaken.