CreateSelectDQ no longer present in DataAccessAdapterCore after upgradef rom 5.7 to 5.10

Posts   
 
    
Zaudio
User
Posts: 8
Joined: 04-Nov-2021
# Posted on: 21-Mar-2023 00:03:48   

Hi, We are now using Adapter for .net6 with 5.10, and a few simple custom templates. We previously used adapter for netstandard2.1 with +5.7

We extended our DataAccessAdapter using a partial class (so not strictly a custom templates problem), and have used this override to date to add query hints certain queries:

        protected override IRetrievalQuery CreateSelectDQ(QueryParameters parameters)
        {
            var result =  base.CreateSelectDQ(parameters);
            switch (AddQueryOption)
            {
                case QueryOption.OptimizeForUnknown:
                    result.Command.CommandText += @" OPTION (OPTIMIZE FOR UNKNOWN)";
                    break;
                case QueryOption.Recompile:
                    result.Command.CommandText += @" OPTION (RECOMPILE)";
                    break;
            }
            return result;
        }

After updating to 5.10, this is broken, as the CreateSelectDQ method no longer exists to override. Please advise how to update our code to continue to use this additional functionality.

Thanks Simon

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39760
Joined: 17-Aug-2003
# Posted on: 21-Mar-2023 09:40:46   
Frans Bouma | Lead developer LLBLGen Pro
Zaudio
User
Posts: 8
Joined: 04-Nov-2021
# Posted on: 21-Mar-2023 16:35:30   

Otis wrote:

This was a breaking change in v5.8: https://www.llblgen.com/Documentation/5.10/LLBLGen%20Pro%20RTF/migratingcode.htm#breaking-changes-v5.8. Please see this link for how to correct your code.

Btw, our runtime does support hints too (QuerySpec / Linq), not sure if that could help too.. https://www.llblgen.com/Documentation/5.10/LLBLGen%20Pro%20RTF/Using%20the%20generated%20code/QuerySpec/gencode_queryspec_generalusage.htm#specifying-query--optimizer-hints-sql-server-mysql-oracle

Thanks Otis, just what I was looking for.

Simon