Cannot find DataAccessAdapter class to override

Posts   
 
    
Posts: 3
Joined: 02-Nov-2009
# Posted on: 02-Nov-2009 15:35:17   

Hi everyone,

I'm trying to access the generated SQL at runtime so i can re-use it for in a separate reporting module which is not using LLBLGEN Pro. I have read many posts that talk about extending the DataAccessAdapter class and overriding the OnFetchEntity or the OnFetchEntityCollection function. Now, I don't know for what reason but I cannot find the location of the DataAccessAdapter class. The closest thing available is the SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase class but it doesn't seem to be what I am supposed to use.
confused

Can someone point me in the right direction?

If someone can supply the skeleton (including "using" statements) of a working class that is extending the DataAccessAdapter class it would be really appreciated!!

Thanks in advance!

Joel

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 02-Nov-2009 15:38:43   

Are you generating the code with the Adapter template set, or the SelfServicing one? Only if you are using the Adapter one, you should find the DataAccessAdapter class generated in the DBSpecific project.

Posts: 3
Joined: 02-Nov-2009
# Posted on: 02-Nov-2009 15:45:42   

I am using the SelfServicing template.

Does this mean I don't have any way of getting to the SQL?

Thanks for the quick response. Incredible support!

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 02-Nov-2009 16:24:37   

I'm not sure but you might need to override some methods (depending on your needs) of the DaoBase class in one or all of the generated dao calsses.

Candidate Methods: ExecuteActionQuery
ExecuteMultiRowDataTableRetrievalQuery ExecuteMultiRowRetrievalQuery
ExecuteScalarQuery
ExecuteSingleRowRetrievalQuery

Which has an IRetrievalQuery or an IActionQuery parameter passed in, which contains the command object.

Posts: 3
Joined: 02-Nov-2009
# Posted on: 02-Nov-2009 18:06:52   

Thanks Walaa!

That worked. The only bad side of this solution is that those changes will be overwritten every time the code is re-generated. Is there a way to change the template to include those overrides?

Thanks!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39862
Joined: 17-Aug-2003
# Posted on: 03-Nov-2009 10:03:19   

Use a partial class

Frans Bouma | Lead developer LLBLGen Pro